Title Description
Enter the scores of 10 students and 5 courses, statistics output 5 courses with the highest score and the lowest student number and their total score.
Input requirements
6 integers per line, 10 rows in total.
The first integer in each line represents the student's number, and the remaining 5 numbers represent the results of his 5 courses.
Output requirements
Two lines, two integers per line.
The number of students with the highest score in the first act, and his total score, are separated by a space.
The number of students with the lowest total score of the second act, and his total score, separated by a space.
If the input
99211201 1 2 3 4 599211207 2 2 3 4 599211217 3 2 3 4 599211227 4 2 3 4 599211231 5 2 3 4 599211232 6 2 3 4 599211233 7 2 3 4 599211235 8 2 3 4 599211236 9 2 3 4 599211237 10 2 3 4 5
should be output
99211237 2499211201 15
1#include <stdio.h>2 intMain ()3 {4 inti,j,n,max,x,min,t,m,h,k;5 inta[Ten][6],b[Ten];6 for(i=0;i<Ten; i++)7 {8 for(j=0;j<6; j + +)9scanf"%d",&A[i][j]); Ten } One for(i=0;i<Ten; i++) A { -m=0; - for(j=1;j<6; j + +) the { -m=m+A[i][j]; - } -b[i]=m; + } -max=b[0]; x=0; +min=b[0]; t=0; A for(i=0;i<Ten; i++) at { - if(max<B[i]) - { -max=B[i]; -x=i; - } in } -printf"%d%d\n", a[x][0],max); to for(i=0;i<Ten; i++) + { - if(min>B[i]) the { *min=B[i]; $t=i;Panax Notoginseng } - } theprintf"%d%d\n", a[t][0],min); + return 0; A}
"Array" 5 total