"SWEA 2068 최대수 구하기"의 두 판 사이의 차이

1번째 줄: 1번째 줄:
==개요==
==개요==
;SWEA 2068 최대수 구하기
;SWEA 2068 최대수 구하기
*  
* https://www.swexpertacademy.com/main/code/problem/problemSubmitHistory.do?contestProbId=AV5QQhbqA4QDFAUq


{{SWEA 헤더}}
{{SWEA 헤더}}
13번째 줄: 13번째 줄:
==Java==
==Java==
<source lang='java'>
<source lang='java'>
import java.util.Scanner;
class Solution {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int t=0; t<T; t++) {
            int max = 0;
            for(int i=0; i<10; i++) {
                int n = sc.nextInt();
                if( n > max ) max = n;
            }
            System.out.format("#%d %d\n", t+1, max);
        }
    }
}
</source>
</source>

2018년 9월 6일 (목) 20:06 판

1 개요

SWEA 2068 최대수 구하기
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 1-1

2 C++

3 Java

import java.util.Scanner;
class Solution {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int t=0; t<T; t++) {
            int max = 0;
            for(int i=0; i<10; i++) {
                int n = sc.nextInt();
                if( n > max ) max = n;
            }
            System.out.format("#%d %d\n", t+1, max);
        }
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}