[SWEA] D1.최대수 구하기 (C++)

jhyunn·2024년 2월 25일
0

SWEA

목록 보기
4/12

2068. 최대수 구하기

문제 링크

#include <iostream>
 
using namespace std;
 
int main() {
    int T;
    cin >> T;
    for (int t = 1; t <= T; t++) {
        int tmp, n;
        for (int i = 0; i < 10; i++) {
            cin >> tmp;
            if (i == 0 || tmp > n) n = tmp;
        }
        cout << "#" << t << " " << n << endl;
    }
}

 
풀이
입력될 때마다 값 비교

profile
https://github.com/Sungjeonghyun

0개의 댓글