# include <iostream>
using namespace std;
int main(){
int mn = 100000, mx = -100000, n;
cin >> n;
while(n--){
int x;
cin >> x;
mn = min(mn, x);
mx = max(mx, x);
}
cout << "MAX : " << mx << "\nMIN : " << mn;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
# include <iostream>
using namespace std;
int main(){
int mn = 100000, mx = -100000, n;
cin >> n;
while(n--){
int x;
cin >> x;
mn = min(mn, x);
mx = max(mx, x);
}
cout << "MAX : " << mx << "\nMIN : " << mn;
}