fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, max = 0;
  5. scanf("%d", &n);
  6. for (int i = 0; i < n; i++) {
  7. int a;
  8. scanf("%d", &a);
  9. if (a > max)
  10. max = a;
  11. }
  12. printf("%d", max);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5284KB
stdin
5
42 39 41 43 30
stdout
43