Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int maximum, minimum, n;
- int main()
- {
- cin>>n>>maximum;
- minimum = maximum;
- for(int i = 1; i < n; i++)
- {
- int a;
- cin>>a;
- if(a > maximum) maximum = a;
- if(a < minimum) minimum = a;
- }
- cout<<minimum<<" "<<maximum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement