fork download
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. cin>>n
  9. int a[n]
  10. {
  11. for ( int i = 0; i < n; i ++)
  12. a [i] = rand ()%100;
  13. }
  14. k=a[0]
  15. for (int i = 1; i < n; i ++ )
  16. {
  17. if (a[i]%2=0)
  18. {
  19. a[i]=a[i]+k;
  20. }
  21. }
  22. cout<<a
  23. return 0;
  24. }
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:7: error: ‘n’ was not declared in this scope
  cin>>n
       ^
prog.cpp:14:2: error: ‘k’ was not declared in this scope
  k=a[0]
  ^
prog.cpp:14:4: error: ‘a’ was not declared in this scope
  k=a[0]
    ^
prog.cpp:15:20: error: ‘i’ was not declared in this scope
    for (int i = 1; i < n; i ++ )
                    ^
stdout
Standard output is empty