fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. int data[10], s;
  8. data[1]=1;
  9. data[2]=2;
  10. data[3]=3;
  11. data[4]=4;
  12. data[5]=5;
  13. data[6]=6;
  14. data[7]=7;
  15. data[8]=8;
  16. data[9]=9;
  17. data[10]=10;
  18. int s=0
  19. for (i=0; i<10; i++)
  20. s+=data[i];
  21. ser=s/10;
  22. count<<"середнє значення дорівнює "<<ser;
  23.  
  24.  
  25. return 0;
  26.  
  27.  
  28.  
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:18:6: error: redeclaration of 'int s'
  int s=0
      ^
prog.cpp:7:19: note: 'int s' previously declared here
     int data[10], s;
                   ^
prog.cpp:19:12: error: 'i' was not declared in this scope
  for (i=0; i<10; i++)
            ^
prog.cpp:21:2: error: 'ser' was not declared in this scope
  ser=s/10;
  ^
prog.cpp:22:5: error: 'count' was not declared in this scope
     count<<"середнє значення дорівнює "<<ser;
     ^
prog.cpp:25:10: error: expected '}' at end of input
  return 0;
          ^
stdout
Standard output is empty