![[C++] 백준 4단계 - 2562번 문제](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fb0JABy%2Fbtr5O9efwMg%2FAAAAAAAAAAAAAAAAAAAAACNxCu_PeW1F9X840sOl0lT1sd0dh7JkvfuhrACdLQH6%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DXK3iICz6xIS0dfJy5axXruLB6YQ%253D)
[C++] 백준 4단계 - 2562번 문제자료구조 & 알고리즘/BOJ2023. 3. 29. 00:12
Table of Contents
문제설명
소스코드
#include <iostream>
using namespace std;
int main() {
int max = 0; int idx;
int arr[9];
for (int i = 0; i < 9; ++i)
{
cin >> arr[i];
if (arr[i] > max)
{
max = arr[i];
idx = i;
}
}
cout << max << endl << idx + 1;
}
'자료구조 & 알고리즘 > BOJ' 카테고리의 다른 글
[C++] 백준 4단계 - 5597번 문제 (0) | 2023.03.30 |
---|---|
[C++] 백준 4단계 - 10810번 문제 (0) | 2023.03.29 |
[C++] 백준 4단계 - 10818번 문제 (0) | 2023.03.29 |
[C++] 백준 4단계 - 10871번 문제 (0) | 2023.03.28 |
[C++] 백준 4단계 - 10807번 문제 (0) | 2023.03.28 |