본문 바로가기
Java/SW Expert Academy

2068. 최대수 구하기

by GLOWWW 2021. 1. 3.
package oSWExpertAcademy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//최대수 구하기 
public class D1_04 {
    public static void main(String[]args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int count = Integer.parseInt(br.readLine());
            for(int i=1; i<=count; i++) {
                String[] nums = br.readLine().split(" ");
                int max = 0;
                for(int j=0; j<10; j++) {
                    if(Integer.parseInt(nums[j])>max) {
                        max = Integer.parseInt(nums[j]);
                    }
                }
                System.out.println("#"+i+" "+max);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

'Java > SW Expert Academy' 카테고리의 다른 글

2046. 스탬프 찍기  (0) 2021.01.05
1859. 백만 장자 프로젝트  (0) 2021.01.04
2070. 큰 놈, 작은 놈, 같은 놈  (0) 2021.01.03
2071. 평균값 구하기  (0) 2021.01.03
2072. 홀수만 더하기  (0) 2021.01.03

댓글