#include <iostream> using namespace std; int x, arr[100005], ans[10]; string s[10] = {"0", "0 - 24 ","25 - 49 ","50 - 74 ","75 - 99 ","100 - 124 ","125 - 149 ","150 - 174 ","175 - 200 "}; int main (){ int cnt = 1; cin >> arr[cnt ++]; while(cin >> x){ arr[cnt ++] = x; } for (int i = 1; i <= 8; i++) ans[i] = 0; for (int i = 1; i < cnt; i ++){ if(arr[i] >= 0 && arr[i] <= 24)ans[1] ++; if (arr[i] >= 25 && arr[i] <= 49) ans[2] ++; if (arr[i] >= 50 && arr[i] <= 74) ans[3] ++; if (arr[i] >= 75 && arr[i] <= 99) ans[4] ++; if (arr[i] >= 100 && arr[i] <= 124) ans[5] ++; if (arr[i] >= 125 && arr[i] <= 149) ans[6] ++; if (arr[i] >= 150 && arr[i] <= 174) ans[7] ++; if (arr[i] >= 175 && arr[i] <= 200) ans[8] ++; } for (int i = 1; i <= 8; i ++){ cout << s[i] << ans[i] << '\n'; } return 0; }</iostream>
点赞
牛客网
牛客企业服务