SW ExpertAcademy/D1

2068. 최대수 구하기

Programmer. 2018. 11. 30. 22:25

2068. 최대수 구하기

문제출처: https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQhbqA4QDFAUq&categoryId=AV5QQhbqA4QDFAUq&categoryType=CODE




풀이 방법



<코드>


#include <iostream>

int main()
{
    int n{0};
    std::cin>>n;
    
    for(int testCase =1;testCase <=n;testCase ++)
    {
        int max{0};
        for(int i=0;i<10;i++) 
        {
            int input{0};
            std::cin>>input;
            if(max<input)
                max = input;
        }
        std::cout<<"#"<<testCase<<' '<<max<<"\n";
    }
    
    return 0;
}