알고리즘/백준
최댓값
슈도코드
2019. 9. 16. 22:28
#include <iostream>
using namespace std;
int main(void)
{
int arr[9];
int max = 0, order = 0;
for (int i = 0; i < 9; i++)
{
cin >> arr[i];
if (arr[i] >= max)
{
max = arr[i];
order = i+1;
}
}
cout << max << '\n';
cout << order << '\n';
return 0;
}
1차원 배열 사용