fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. ios_base::sync_with_stdio(false);
  5. long long N,x;
  6. cin>> N;
  7. long long q[N];
  8. for (long long i=0; i<N; i++) {
  9. cin >> q[i];
  10. }
  11. for(long long i=0; i<N; i++){
  12. cin >> x;
  13. q[i]=x;
  14. long long menor=0;
  15. for(long long i=1; i<=N; i++){
  16. if(q[i] > q[menor]){
  17. menor=i;
  18. }
  19. }
  20. }
  21. cout<< q[i] << "\n";
  22. }
Compilation error #stdin compilation error #stdout 0s 4476KB
stdin
10
20 25 85 40 25 90 25 40 55 40
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:21:15: error: ‘i’ was not declared in this scope
      cout<< q[i] << "\n";
               ^
stdout
Standard output is empty