Language: C++

#include<iostream>
using namespace


int main(){

int x  , y;
char z;
cin >> x >>  z  >> y;

while( z != ? ){

if( z == + ){

cout << x << " + " << y << endl;

}

else if( z == - ){

cout << x << " - " << y << endl;

}

else if ( z == *){

cout << x << " * " << y << endl;

}

else if ( z == / ){

cout << x << " / " << y << endl;

}


}

return 0 ;

}

Compiler output:
a.cc:5:1: error: expected identifier before 'int'
    5 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
......
    5 | int main(){
      | ~~~             
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin >> x >>  z  >> y;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:13: error: expected primary-expression before '?' token
   11 | while( z != ? ){
      |             ^
a.cc:11:15: error: expected primary-expression before ')' token
   11 | while( z != ? ){
      |               ^
a.cc:11:14: error: expected ':' before ')' token
   11 | while( z != ? ){
      |              ^~
      |              :
a.cc:11:15: error: expected primary-expression before ')' token
   11 | while( z != ? ){
      |               ^
a.cc:13:12: error: expected primary-expression before ')' token
   13 | if( z == + ){
      |            ^
a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout << x << " + " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 | cout << x << " + " << y << endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:19:17: error: expected primary-expression before ')' token
   19 | else if( z == - ){
      |                 ^
a.cc:21:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 | cout << x << " - " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 | cout << x << " - " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:25:17: error: expected primary-expression before ')' token
   25 | else if ( z == *){
      |                 ^
a.cc:27:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 | cout << x << " * " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:27:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 | cout << x << " * " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:31:16: error: expected primary-expression before '/' token
   31 | else if ( z == / ){
      |                ^
a.cc:31:18: error: expected primary-expression before ')' token
   31 | else if ( z == / ){
      |                  ^
a.cc:33:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 | cout << x << " / " << y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   33 | cout << x << " / " << y << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~