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