题解 | #统计同成绩学生人数#
统计同成绩学生人数
https://www.nowcoder.com/practice/987123efea5f43709f31ad79a318ca69
#include <cstdio> #include <cstring> using namespace std; int hashtable[101]; int main() { int n,target; while (scanf("%d",&n)!=EOF) { // 注意 while 处理多个 case if(n==0) break; memset(hashtable,0,101); while(0<n--) { scanf("%d",&target); ++hashtable[target]; } scanf("%d",&target); printf("%d\n",hashtable[target]); } } // 64 位输出请用 printf("%lld")