Who is the best coder

Source: Internet
Author: User

Describe

There are many coder, handsome want to know whether they are the most comprehensive strength of the coder. handsome like handsome, so he chose the handsome and programming level as the selection criteria. Each student's comprehensive score is a handsome degree score with a programming level score. He wants you to write a program to help him.  
Input
There are multiple groups of data.
Enter a number n, representing the total number of participants in the accounting.
Next there are n rows, with a number of two in a row, a, B.
Where a represents the level of programming of the students, B represents the degree of handsome students.
n=0 Indicates the end of the input.
Output
One
row for each group of data, output the highest scores of all the students in the composite.
Sample input
59 107 111 65 73 527 37 60
Sample output
1913

1 ImportJava.util.Scanner;2 3  Public classMain {4      Public Static voidMain (string[] args) {5Scanner scanner=NewScanner (system.in);6         intN;7         inti;8         intMax;9         intA;Ten         intb; One          A          while(true){ -n=scanner.nextint (); -              the             if(n==0) -                  Break; -              -Max=0; +              for(i=0;i<n;i++){ -A=scanner.nextint (); +b=scanner.nextint (); A                  at                 if(a+b>max) -max=a+b; -             } - System.out.println (max);  -         }      -     }  in}

Who is the best coder

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.