[백준] 최댓값 2562

Soohyeon B·2022년 10월 17일
0

알고리즘 문제 풀이

목록 보기
20/70
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int max = 0;
  int maxNum=0;
  for(int i=1; i<=9; i++){
    int t;
    cin >> t;
    if(t>max) {
        max = t; maxNum=i;
        
    }
  }
  
  cout << max<<"\n" << maxNum;
}
profile
하루하루 성장하는 BE 개발자

0개의 댓글