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