fork download
  1. // Level 1 - Homework 1 - Question E - Solution 1.
  2. #include <iostream>
  3. #include <climits>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int N = 0;
  10. int X = 0;
  11. cin >> N;
  12.  
  13. int Max = INT_MIN;
  14. for(int i = 0; i < N; ++i)
  15. {
  16. cin >> X;
  17.  
  18. if(X > Max)
  19. Max = X;
  20. }
  21.  
  22. cout << Max << endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 5312KB
stdin
5
1 8 5 7 5
stdout
8