"Array" 5 total

Source: Internet
Author: User

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

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.