fork download
  1. #include <bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define el endl
  5. #define nl '\n'
  6. #define all(v) v.begin(), v.end()
  7. using namespace std;
  8.  
  9. void input()
  10. {
  11. if (fopen("in.txt", "r"))
  12. {
  13. freopen("in.txt", "r", stdin);
  14. freopen("out.txt", "w", stdout);
  15. }
  16. }
  17.  
  18. void init()
  19. {
  20. ios_base::sync_with_stdio(false);
  21. cin.tie(nullptr);
  22. }
  23. int main()
  24. {
  25. Fast:
  26. input();
  27. init();
  28. //---------------------------------------------------------------------------------------------------------------
  29. int n, MaxNum = INT_MIN;
  30.  
  31. cin >> n;
  32. int ar[n];
  33. for (int i = 0; i < n; i++)
  34. {
  35. cin >> ar[i];
  36.  
  37. if (ar[i] > MaxNum)
  38. MaxNum = ar[i];
  39. }
  40. cout << MaxNum << nl;
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
2147479976