Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- String line, max_nev="";
- int max = 0;
- Scanner sc = new Scanner(System.in);
- while (sc.hasNext()){
- line = sc.nextLine();
- String[] tok = line.split(" ");
- int iq = Integer.parseInt(tok[0]);
- if (iq == 0 && line.length() == 1){
- break;
- }
- String nev = tok[1];
- if (iq > max){
- max = iq;
- max_nev = nev;
- }
- }
- if (max > 0)
- System.out.println(max_nev + " [" + max + "]");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement