fork download
  1. //---------------------------------------------------------------------------
  2. //#include <conio.h>
  3. #include <iostream>
  4. #pragma hdrstop
  5.  
  6. //---------------------------------------------------------------------------
  7.  
  8. #pragma argsused
  9. int main(int argc, char* argv[])
  10. {
  11. int x,y,z;
  12. //ââåäåíèå çíà÷åíèé
  13. cout << "vvedi x" << endl;
  14. cin>>x;
  15. cout << "vvedi y" << endl;
  16. cin>>y;
  17. cout << "vvedi z" << endl;
  18. cin>>z;
  19.  
  20. int max_xy,max_yz,g
  21.  
  22. if(x>y)max_xy=x;
  23. else max_xy=y;
  24.  
  25. if (y>z )
  26. {max_yz=y};
  27. else
  28. {max_yz=z};
  29.  
  30. if ( max_xy<max_yz)
  31. {g= max_xy/ max_yz}
  32. else
  33. {g= max_yz/ max_yz}
  34. cout << "g=" <<g<< endl;
  35. getch();
  36. return 0;
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:13:1: error: ‘cout’ was not declared in this scope
 cout << "vvedi x" << endl;
 ^~~~
prog.cpp:13:1: note: suggested alternative:
In file included from prog.cpp:3:0:
/usr/include/c++/6/iostream:61:18: note:   ‘std::cout’
   extern ostream cout;  /// Linked to standard output
                  ^~~~
prog.cpp:13:22: error: ‘endl’ was not declared in this scope
 cout << "vvedi x" << endl;
                      ^~~~
prog.cpp:13:22: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
                 from prog.cpp:3:
/usr/include/c++/6/ostream:590:5: note:   ‘std::endl’
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
prog.cpp:14:1: error: ‘cin’ was not declared in this scope
 cin>>x;
 ^~~
prog.cpp:14:1: note: suggested alternative:
In file included from prog.cpp:3:0:
/usr/include/c++/6/iostream:60:18: note:   ‘std::cin’
   extern istream cin;  /// Linked to standard input
                  ^~~
prog.cpp:22:1: error: expected initializer before ‘if’
 if(x>y)max_xy=x;
 ^~
prog.cpp:23:1: error: ‘else’ without a previous ‘if’
 else max_xy=y;
 ^~~~
prog.cpp:26:10: error: expected ‘;’ before ‘}’ token
 {max_yz=y};
          ^
prog.cpp:27:1: error: ‘else’ without a previous ‘if’
 else
 ^~~~
prog.cpp:28:10: error: expected ‘;’ before ‘}’ token
 {max_yz=z};
          ^
prog.cpp:31:2: error: ‘g’ was not declared in this scope
 {g=  max_xy/ max_yz}
  ^
prog.cpp:33:2: error: ‘g’ was not declared in this scope
 {g=  max_yz/ max_yz}
  ^
prog.cpp:34:16: error: ‘g’ was not declared in this scope
 cout << "g=" <<g<< endl;
                ^
prog.cpp:35:7: error: ‘getch’ was not declared in this scope
 getch();
       ^
stdout
Standard output is empty