문제
백준 10818 – https://www.acmicpc.net/problem/10818
암호
#include <iostream>
using namespace std;
int main () {
int n = 0;
int x = 0;
int min = 1000000;
int max = -1000000;
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> x;
if (x < min)
{
min = x;
}
if (x > max)
{
max = x;
}
}
cout << min << " " << max << endl;
return 0;
}
결과