Bomb Kirby Running
Cat Life - GT-K
2068번 최대수 구하기

2023. 3. 20. 17:29SWEA

Problem Solving - Level 1 - 최대수 구하기

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&contestProbId=AV5QQhbqA4QDFAUq&categoryId=AV5QQhbqA4QDFAUq&categoryType=CODE

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    int N;
    int arr[10];
    cin>>N;
     
    for(int i=1;i<=N;i++)
    {
        for(int j=0;j<10;j++)
        {
            cin>>arr[j];
        }
         
        int m=arr[0];
         
        for(int j=1;j<10;j++)
        {
            m=max(m,arr[j]);
        }
        cout<<"#"<<i<<" "<<m<<endl;
    }
     
    return 0;
}

'SWEA' 카테고리의 다른 글

2071번 평균값 구하기  (0) 2023.03.23
2070번 큰 놈, 작은 놈, 같은 놈  (0) 2023.03.20
2063번 중간값 찾기  (0) 2023.03.20
2058번 자릿수 더하기  (0) 2023.03.20
2056번 연월일 달력  (0) 2023.03.20