fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.  
  9. ios_base::sync_with_stdio(0);
  10. cin.tie(0);
  11. cout.tie(0);
  12.  
  13. int n;
  14. cin >> n;
  15.  
  16. vector<int> ted(n);
  17.  
  18. for(int i = 0; i < n; i++)
  19. { cin >> ted[i];
  20.  
  21. }
  22. sort( ted.begin(), ted.end());
  23.  
  24.  
  25.  
  26. cout<< ted[n-1];
  27.  
  28.  
  29.  
  30.  
  31.  
  32. return 0;
  33. }
Success #stdin #stdout 0s 5316KB
stdin
4
6 10 2 5
stdout
10