题解 | #统计同成绩学生人数#
统计同成绩学生人数
https://www.nowcoder.com/practice/987123efea5f43709f31ad79a318ca69
#include <iostream> #include <map> using namespace std; const int N = 1010; int n; map<int, int> score; int main() { while (cin >> n) { if(n==0) break; score.clear(); for (int i = 0; i < n; i++) { int x; cin >> x; score[x]++; } int grade; cin >>grade; cout << score[grade] << endl; } } // 64 位输出请用 printf("%lld")