[Algorithm] BOJ 2562
#include <iostream>
#include <string>
using namespace std;
int main()
{
int arr[9];
int num,tmp = 0,cnt = 0;
for(int i = 0; i < 9; i++)
{
cin >> num;
arr[i] = num;
if(i == 0)
{
tmp = num;
}
else
{
if(num > tmp)
tmp = num;
else
continue;
}
}
cout << tmp << "\n";
for(int i = 0; i < 9; i++)
{
cnt += 1;
if(tmp == arr[i])
{
cout << cnt << "\n";
break;
}
}
return 0;
}
댓글남기기