asgarlikanan

https://www.e-olymp.com/az/problems/928

Aug 19th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.29 KB | None | 0 0
  1. /*
  2.     Author: Kanan Asgarli
  3.     https://www.e-olymp.com/az/problems/928
  4. */
  5. #include <iostream>
  6. #include <algorithm>
  7. using namespace std;
  8. int n, a[100];
  9. int main()
  10. {
  11.     cin>>n;
  12.     for(int i = 0; i < n; i++){
  13.         cin>>a[i];
  14.     }
  15.     sort(a,a+n);
  16.     cout<<a[0]+a[n-1]<<endl;
  17.        
  18.     return 0;
  19. }
Add Comment
Please, Sign In to add comment