fork download
  1. #include "iostream"
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, i = 0, max = 0;
  7. cin >> n;
  8. int A[n];
  9. for (i = 0; i < n; i++) {
  10. cin >> A[i];
  11. if (A[i] > max) {
  12. max = A[i];
  13. }
  14. }
  15. cout << max;
  16. }
Success #stdin #stdout 0s 4540KB
stdin
3
0 3 0
stdout
3