Home > Back-end >  Acm grade of the final exam
Acm grade of the final exam

Time:06-07


The final exam of hierarchical
Time Limit: 1000 ms Memory Limit: 65536 KiB
Submit Statistic
Problem Description
The final exam is over, the teacher want according to students' scores divided into level, with A total of five grade A, B, C, D and E,
Division method is as follows, more than 90 (including 90) for A, between 80 ~ 90 (including 80) for B, for between 70 ~ 80 (including 70) C,
60 ~ 70 (60) for D, failing to E,
Programming based on the input, output all levels paragraph number,


Input
Enter the first line contains a positive integer N (N<=100) represents the number of the students, then there are N rows of data in each row (0 ~ 100) represents an integer
A student's grades,
The Output
Have five lines of output format is as follows:
A nA
NB B
C nC
D nD
E nE
Including A, B, C, D, E for grades, nA, nB, etc. On behalf of A level number, grade and there is A space between the number,
The Sample Input
6
66
73
85
99
100
59
The Sample Output
A 2
B 1
C 1
D 1
E 1
Hint
The Source
S




#include

Int main ()
{
Int A=0, B=0, C=0, D=0, E=0, I, N, N.
The scanf (" % d ", & amp; N);
for(i=1; i<=N; I++)
{
The scanf (" % d ", & amp; N);
If (n>
=90){
+;
}
Else if (n>
=80){
B++;
}
Else if (n>
=70){
C + +;
}
Else if (n>=60)
{
D++;
}
The else
{
E++;
}
}
Printf (" A % d \ n ", A);
Printf (" % d \ n B ", B);
Printf (" % d \ n "C, C);
Printf (" \ n D % D ", D);
Printf (" % d "E, E);
return 0;
}

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related