fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin>>n;
  7. int a[n];
  8. for(int i=0; i<n; i++){
  9. cin>>a[i];
  10. }
  11. int max=0;
  12. for(int i=0; i<n; i++){
  13. if(a[i]>max) max=a[i];
  14. }
  15. cout<<max<<" "<<endl;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5280KB
stdin
10
14 -9 7 -44 -20 7 48 41 -32 40

stdout
48