#include<stdio.h> int a[1001]; int main(int argc, char *argv[]) { int N; while(~scanf("%d",&N)) { if(N==0)return 0; for(int i=0;i<N;++i) scanf("%d",&a[i]); int num; int cnt=0; scanf("%d",&num); for(int i=0;i<N;++i) if(a[i]==num) { cnt++; } printf("%d\n",cnt); } return 0; } /************************************************************** Problem: 1018 User: kirchhoff Language: C Result: Accepted Time:10 ms Memory:916 kb ****************************************************************/
原文地址:http://blog.csdn.net/wdkirchhoff/article/details/42240865