标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1235
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16022 Accepted Submission(s): 9214
1 #include <iostream> 2 #include <cstdio> 3 4 using namespace std; 5 6 int main() 7 { 8 int n,a,ans; 9 int num[1010]; 10 while (~scanf("%d",&n)) 11 { 12 ans=0; 13 if (n==0) 14 break; 15 for (int i=0;i<n;i++) 16 { 17 scanf("%d",&num[i]); 18 } 19 scanf("%d",&a); 20 for (int i=0;i<n;i++) 21 { 22 if (num[i]==a) 23 ans++; 24 } 25 printf ("%d\n",ans); 26 } 27 return 0; 28 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4622903.html