728x90

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&contestProbId=AV5QQhbqA4QDFAUq&categoryId=AV5QQhbqA4QDFAUq&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=JAVA&select-1=1&pageSize=10&pageIndex=1

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

 

풀이)

import java.util.Scanner;
import java.io.FileInputStream;
 

class Solution
{
    public static void main(String args[]) throws Exception
    {
         
        Scanner sc = new Scanner(System.in);
        int T;
        T=sc.nextInt();
         
 
        for(int test_case = 1; test_case <= T; test_case++)
        {
         
            int[] idx = new int[10];
            for(int i=0; i<10; i++){
                idx[i]=sc.nextInt();
            }
            int max = idx[0];
            for(int i=0; i<idx.length; i++){
                if(max<idx[i]){
                    max = idx[i];
                }
            }
            System.out.println("#"+test_case+" "+max);
 
        }
    }
}

 

728x90