fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. //freopen("input.txt", "r", stdin);
  6. //freopen("output.txt", "w", stdout);
  7.  
  8.  
  9. int N,a,i,M;
  10. scanf("%d",&N);
  11. scanf("%d",&a);
  12. for(i=1;i<N;i++)
  13. {
  14. scanf("%d",&M);
  15. if(M>a)
  16. {a=M;}
  17. }
  18.  
  19. printf("%d\n",a); // your code goes here
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3344KB
stdin
12
-331 -341 389 349 -37 -287 441 -871 -913 -853 -617 -150
stdout
441