Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
329 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
int n[5];

for (int i = 0; i < 5; i++) {
	cin >> n[i];
}
int max = n[0];
int min = n[0];
for (int i = 0; i < 5; i++) {
	if ( n[i] < min) {
		min = n[i];
	}
	if (n[i] > max) {
		max = n[i];
	}
}
//n[i];->n[0], n[1] ....n[4];
cout << min << " " << max;
}
Leave a Comment