fork(1) 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 3336KB
stdin
Standard input is empty
stdout
Standard output is empty