【hdu 1235 !water~~~~~~~~~`】

 1 // Project name : 1235 ( 统计同成绩学生人数 ) 
 2 // File name    : main.cpp
 3 // Author       : Izumu
 4 // Date & Time  : Thu Jul  5 17:20:47 2012
 5 
 6 
 7 #include <iostream>
 8 #include <stdio.h>
 9 using namespace std;
10 
11 int main()
12 {
13     int n;
14     while (scanf("%d", &n) != EOF && n)
15     {
16         int* a;
17         a = new int[n];
18         for (int i = 0; i < n; i++)
19         {
20             scanf("%d", &a[i]);
21         }
22 
23         int score;
24         scanf("%d", &score);
25 
26         int count = 0;
27         for (int i = 0; i < n; i++)
28         {
29             if (score == a[i])
30             {
31                 count++;
32             }
33         }
34 
35         cout << count << endl;
36 
37     }
38     return 0;
39 }
40 
41 // end 
42 // ism 
原文地址:https://www.cnblogs.com/ismdeep/p/2578191.html