Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- ///wellcode.ro
- using namespace std;
- /**
- 5
- 2 7 9 1 3 */
- int main()
- {
- int n, x, maxx = -1, minn = 51, i; ///am declarat minimul si maximul
- cin >> n;
- for( i = 1; i <= n; i++ ){
- cin >> x;
- if( x > maxx ){ /// actualizez maximul
- maxx = x;
- }
- if( x < minn ){ /// actualizez minimul
- minn = x;
- }
- }
- cout << minn << " " << maxx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement