fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iomanip>
  4. #include <cmath>
  5. using namespace std;
  6.  
  7. int main() {
  8. int m;
  9. cin >> m;
  10. long long int max = 0;
  11. for (int i = 0; i < m; i++) {
  12. int x;
  13. cin >> x;
  14. if (max < x)max = x;
  15. }
  16.  
  17. cout << max;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5280KB
stdin
4
12 17 9 7
stdout
17