fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int x, y, r, t, f, g, u = 0;
  6. cout<<"Enter x:"<<endl;//введите значение аргумента
  7. cin>>x;//записать введённое значение в перменную х
  8. int y = 0;
  9. int r = x + 7;
  10. int t = 4;
  11. int f = x*x;
  12. int g = -2 * x + 8;
  13. int u = 0;
  14. if (x <= -9 || x <= -7){
  15. cout<<y<<endl;
  16. } else if (x <= -7 || x <= -3){
  17. cout<<r<<endl;
  18. }else if (x < = -3 || x <= -2){
  19. cout<<t<<endl;
  20. } else if (x <= -2 || x <= 2){
  21. cout<<f<<endl;
  22. } else if (x <= 2 || x <= 4){
  23. cout<<g<<endl;
  24. } else if (x <= 4 || x <= 7){
  25. cout<<u<<endl;
  26. } else {
  27. cout<<"Dannoe znachenie x ne udovletvoryaet nacalnomu usloviu"<<endl;
  28. }
  29. system("pause");
  30. return 0;
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 3344KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:6: error: redeclaration of ‘int y’
  int y = 0;
      ^
prog.cpp:5:8: error: ‘int y’ previously declared here
 int x, y, r, t, f, g, u = 0;
        ^
prog.cpp:9:6: error: redeclaration of ‘int r’
  int r = x + 7;
      ^
prog.cpp:5:11: error: ‘int r’ previously declared here
 int x, y, r, t, f, g, u = 0;
           ^
prog.cpp:10:5: error: redeclaration of ‘int t’
 int t = 4;
     ^
prog.cpp:5:14: error: ‘int t’ previously declared here
 int x, y, r, t, f, g, u = 0;
              ^
prog.cpp:11:5: error: redeclaration of ‘int f’
 int f = x*x;
     ^
prog.cpp:5:17: error: ‘int f’ previously declared here
 int x, y, r, t, f, g, u = 0;
                 ^
prog.cpp:12:5: error: redeclaration of ‘int g’
 int g = -2 * x + 8;
     ^
prog.cpp:5:20: error: ‘int g’ previously declared here
 int x, y, r, t, f, g, u = 0;
                    ^
prog.cpp:13:5: error: redeclaration of ‘int u’
 int u = 0;
     ^
prog.cpp:5:23: error: ‘int u’ previously declared here
 int x, y, r, t, f, g, u = 0;
                       ^
prog.cpp:18:15: error: expected primary-expression before ‘=’ token
 }else if (x < = -3 || x <= -2){
               ^
stdout
Standard output is empty