SWexpertAcademy(2068)

최대 수 구하기

import java.util.Scanner;
public class Solution {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int []student = new int[10];
		int N = stdIn.nextInt();
		int number = 1;
		int max = 0;
		for (int i = 0; i<N; i++) {
			for ( int j = 0; j<10; j++) {
				int Num = stdIn.nextInt();
				student[j]= Num;
			}
			for(int k = 0 ; k<10; k ++) {
				if(student[k]> max){
					max = student[k];
				 	}
			}
			System.out.println("#" + number +" "+ max);
			number++;
			max=0;
		}

	}
}



참고자료

0%