fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7. int array1[10]; // объявляем целочисленный массив
  8. cout « "1" « endl;
  9. int sum = 0;
  10. for ( int counter = 0; counter < 10; counter++ ) // цикл для считывания чисел
  11. cin » array1[counter]; // считываем вводимые с клавиатуры числа
  12. cout « "2 = ";
  13. for ( int counter = 0; counter < 10; counter++ ) // цикл для вывода элементов массива
  14. cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода
  15. for ( int counter = 0; counter < 10; counter++ ) // цикл для суммирования чисел массива
  16. sum += array1[counter]; // суммируем элементы массива
  17.  
  18. cout « "3 = " « sum« endl; //выводим сумму элементов масива
  19. cout « "4 = " « sum/10.00« endl; //выводим деление этой суммы на 10
  20. system("pause");
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:6: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « "1" « endl; 
     ^~
prog.cpp:8:5: error: expected ';' after expression
cout « "1" « endl; 
    ^
    ;
prog.cpp:8:13: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « "1" « endl; 
           ^~
prog.cpp:8:12: error: expected ';' after expression
cout « "1" « endl; 
          ^
          ;
prog.cpp:8:16: error: reference to overloaded function could not be resolved; did you mean to call it?
cout « "1" « endl; 
             ^~~~
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/ostream:564:5: note: possible target for call
    endl(basic_ostream<_CharT, _Traits>& __os)
    ^
prog.cpp:11:5: error: non-ASCII characters are not allowed outside of literals and identifiers
cin » array1[counter]; // считываем вводимые с клавиатуры числа 
    ^~
prog.cpp:11:4: error: expected ';' after expression
cin » array1[counter]; // считываем вводимые с клавиатуры числа 
   ^
   ;
prog.cpp:11:1: warning: expression result unused [-Wunused-value]
cin » array1[counter]; // считываем вводимые с клавиатуры числа 
^~~
prog.cpp:11:15: error: use of undeclared identifier 'counter'
cin » array1[counter]; // считываем вводимые с клавиатуры числа 
             ^
prog.cpp:12:6: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « "2 = "; 
     ^~
prog.cpp:12:5: error: expected ';' after expression
cout « "2 = "; 
    ^
    ;
prog.cpp:14:6: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
     ^~
prog.cpp:14:5: error: expected ';' after expression
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
    ^
    ;
prog.cpp:14:1: warning: expression result unused [-Wunused-value]
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
^~~~
prog.cpp:14:25: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
                       ^~
prog.cpp:14:24: error: expected ';' after expression
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
                      ^
                      ;
prog.cpp:14:16: error: use of undeclared identifier 'counter'
cout « array1[counter] « " "; // выводим элементы массива на стандартное устройство вывода 
              ^
prog.cpp:18:6: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « "3 = " « sum« endl; //выводим сумму элементов масива 
     ^~
prog.cpp:18:5: error: expected ';' after expression
cout « "3 = " « sum« endl; //выводим сумму элементов масива 
    ^
    ;
prog.cpp:18:16: error: non-ASCII characters are not allowed outside of literals and identifiers
cout « "3 = " « sum« endl; //выводим сумму элементов масива 
              ^~
prog.cpp:18:15: error: expected ';' after expression
cout « "3 = " « sum« endl; //выводим сумму элементов масива 
             ^
             ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
stdout
Standard output is empty