Hdu1235 count students with the same score

Source: Internet
Author: User

Count the number of students with the same score Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others) Total submission (s): 13735 accepted submission (s): 8033

The Problem description reads the scores of N students and outputs the number of students who have obtained a given score.

The input test input contains several test cases. The format of each test case is


Row 3: N
Row 2nd: scores of N students. Two Adjacent numbers are separated by a space.
Row 3rd: Given score

When n = 0 is read, the input ends. Where n does not exceed 1000, and the score is an integer (including) between 0 and 100.

Output for each test case, the number of students with a given score is output.

Sample Input
 
380 60 9060285 660560 75 90 55 75750

Sample output
 
102HintHint Huge input, scanf is recommended.

Source Zhejiang University Computer postgraduate review computer examination-2006

 
# Include <stdio. h> # include <string. h> # define maxn 102int arr [maxn]; int main () {int n, m; while (scanf ("% d", & N), n) {memset (ARR, 0, sizeof (ARR); While (n --) {scanf ("% d", & M); ++ arr [m];} scanf ("% d", & M); printf ("% d \ n", arr [m]);} return 0 ;}


statistics on the number of students with the same score in hdu1235

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.