criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    char op;
    while(1){
        cin>>a>>op>>b;
        if(op==?){
            break;
        }
        else{
           if(op==+){
               cout<<a+b<<endl;
           } 
           else if(op==-){
               cout<<a-b<<endl;
           }
           else if(op==*){
               cout<<a*b<<endl;
           }
           else if(op==/){
               cout<<a/b<<endl;
           }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before '?' token
    8 |         if(op==?){
      |                ^
a.cc:8:17: error: expected primary-expression before ')' token
    8 |         if(op==?){
      |                 ^
a.cc:8:17: error: expected ':' before ')' token
    8 |         if(op==?){
      |                 ^
      |                 :
a.cc:8:17: error: expected primary-expression before ')' token
a.cc:12:20: error: expected primary-expression before ')' token
   12 |            if(op==+){
      |                    ^
a.cc:15:25: error: expected primary-expression before ')' token
   15 |            else if(op==-){
      |                         ^
a.cc:18:25: error: expected primary-expression before ')' token
   18 |            else if(op==*){
      |                         ^
a.cc:21:24: error: expected primary-expression before '/' token
   21 |            else if(op==/){
      |                        ^
a.cc:21:25: error: expected primary-expression before ')' token
   21 |            else if(op==/){
      |                         ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    char op;
    while(1){
        cin>>a>>op>>b;
        if(op==?){
            break;
        }
        else{
           if(op==+){
               cout<<a+b<<endl;
           } 
           else if(op==-){
               cout<<a-b<<endl;
           }
           else if(op==*){
               cout<<a*b<<endl;
           }
           else if(op==/){
               cout<<a/b<<endl;
           }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before '?' token
    8 |         if(op==?){
      |                ^
a.cc:8:17: error: expected primary-expression before ')' token
    8 |         if(op==?){
      |                 ^
a.cc:8:17: error: expected ':' before ')' token
    8 |         if(op==?){
      |                 ^
      |                 :
a.cc:8:17: error: expected primary-expression before ')' token
a.cc:12:20: error: expected primary-expression before ')' token
   12 |            if(op==+){
      |                    ^
a.cc:15:25: error: expected primary-expression before ')' token
   15 |            else if(op==-){
      |                         ^
a.cc:18:25: error: expected primary-expression before ')' token
   18 |            else if(op==*){
      |                         ^
a.cc:21:24: error: expected primary-expression before '/' token
   21 |            else if(op==/){
      |                        ^
a.cc:21:25: error: expected primary-expression before ')' token
   21 |            else if(op==/){
      |                         ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    char op;
    while(1){
        cin>>a>>op>>b;
        if(op=="?"){
            break;
        }
        else{
           if(op=="+"){
               cout<<a+b<<endl;
           } 
           else if(op=="-"){
               cout<<a-b<<endl;
           }
           else if(op=="*"){
               cout<<a*b<<endl;
           }
           else if(op=="/"){
               cout<<a/b<<endl;
           }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(op=="?"){
      |            ~~^~~~~
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |            if(op=="+"){
      |               ~~^~~~~
a.cc:15:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |            else if(op=="-"){
      |                    ~~^~~~~
a.cc:18:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |            else if(op=="*"){
      |                    ~~^~~~~
a.cc:21:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |            else if(op=="/"){
      |                    ~~^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,x,y,z,w;
    char op;
    while(true){
        cin>>a>>op>>b;
        if(op=="?"){
            break;
        }
        else{
           if(op=="+"){
               x=a+b;
               cout<<x<<endl;
           } 
           else if(op=="-"){
               y=a-b;
               cout<<y<<endl;
           }
           else if(op=="*"){
               z=a*b;
               cout<<z<<endl;
           }
           else if(op=="/"){
               w=a/b;
               cout<<w<<endl;
           }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(op=="?"){
      |            ~~^~~~~
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |            if(op=="+"){
      |               ~~^~~~~
a.cc:16:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |            else if(op=="-"){
      |                    ~~^~~~~
a.cc:20:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |            else if(op=="*"){
      |                    ~~^~~~~
a.cc:24:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |            else if(op=="/"){
      |                    ~~^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,x,y,z,w;
    char op;
    while(true){
        cin>>a>>op>>b;
        if(op="?"){
            break;
        }
        else{
           if(op="+"){
               x=a+b;
               cout<<x<<endl;
           } 
           else if(op="-"){
               y=a-b;
               cout<<y<<endl;
           }
           else if(op="*"){
               z=a*b;
               cout<<z<<endl;
           }
           else if(op="/"){
               w=a/b;
               cout<<w<<endl;
           }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    8 |         if(op="?"){
      |               ^~~
      |               |
      |               const char*
a.cc:12:18: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |            if(op="+"){
      |                  ^~~
      |                  |
      |                  const char*
a.cc:16:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   16 |            else if(op="-"){
      |                       ^~~
      |                       |
      |                       const char*
a.cc:20:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   20 |            else if(op="*"){
      |                       ^~~
      |                       |
      |                       const char*
a.cc:24:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   24 |            else if(op="/"){
      |                       ^~~
      |                       |
      |                       const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    while(1){
        int a,b;
        cin>>a>>op>>b;
        if(op=="?")break;
        cout<<a op b<<endl;
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'op' was not declared in this scope
    7 |         cin>>a>>op>>b;
      |                 ^~
a.cc:9:16: error: expected ';' before 'op'
    9 |         cout<<a op b<<endl;
      |                ^~~
      |                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    while(1){
        int a,b;
        cin>>a>>op>>b;
        if(op=="?")break;
        if(op=="+"){
            cout<<a+b<<endl;
        }else if(op=="-"){
            cout<<a-b<<endl;
        }else if(op=="*"){
            cout<<a*b<<endl;
        }else{
            cout<<a/b<<endl;
        }
        
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'op' was not declared in this scope
    7 |         cin>>a>>op>>b;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    while(1){
        int a,b;
        cin>>a>>op>>b;
        if(op=="?")break;
        if(op=="+"){
            cout<<a+b<<endl;
        }else if(op=="-"){
            cout<<a-b<<endl;
        }else if(op=="*"){
            cout<<a*b<<endl;
        }else{
            cout<<a/b<<endl;
        }
        
        
    }return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'op' was not declared in this scope
    7 |         cin>>a>>op>>b;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    while(1){
        int a,b;
        char op;
        cin>>a>>op>>b;
        if(op=="?")break;
        if(op=="+"){
            cout<<a+b<<endl;
        }else if(op=="-"){
            cout<<a-b<<endl;
        }else if(op=="*"){
            cout<<a*b<<endl;
        }else{
            cout<<a/b<<endl;
        }
        
        
    }return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(op=="?")break;
      |            ~~^~~~~
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(op=="+"){
      |            ~~^~~~~
a.cc:12:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         }else if(op=="-"){
      |                  ~~^~~~~
a.cc:14:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         }else if(op=="*"){
      |                  ~~^~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<math.h>
#define _USE_MATH_DEFINES
using namespace std;
int main(){
  int a,b;
  String op;
  while(op=="?"){
  cin >> a >> op >> b;
  if(op=="+"){
    cout << a+b;
  }else if(op=="-"){
    cout << a-b;
  }else if(op=="*"){
    cout << a*b;
  }else if(op=="/"){
    cout << a/b;
  }
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'String' was not declared in this scope
    8 |   String op;
      |   ^~~~~~
a.cc:9:9: error: 'op' was not declared in this scope
    9 |   while(op=="?"){
      |         ^~
Language: C++

#include<iostream>
#include<stdio.h>
#include<math.h>
#define _USE_MATH_DEFINES
using namespace std;
int main(){
  int a,b;
   char op;
  while(op=="?"){
  cin >> a >> op >> b;
  if(op=="+"){
    cout << a+b;
  }else if(op=="-"){
    cout << a-b;
  }else if(op=="*"){
    cout << a*b;
  }else if(op=="/"){
    cout << a/b;
  }
}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   while(op=="?"){
      |         ~~^~~~~
a.cc:11:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(op=="+"){
      |      ~~^~~~~
a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   }else if(op=="-"){
      |            ~~^~~~~
a.cc:15:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   }else if(op=="*"){
      |            ~~^~~~~
a.cc:17:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |   }else if(op=="/"){
      |            ~~^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,x;
    char op;
    while(1){
        cin >> a >> op >> b;
        if ( op = '?') {break};
        
        if ( op == '+' ){x=a+b;}
        else if ( op == '-' ){x=a-b;} 
        else if ( op == '*' ){x=a*b;}
        else if ( op == '/' ){x=a/b;}
        cout << x << endl;
    }return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: expected ';' before '}' token
    8 |         if ( op = '?') {break};
      |                              ^
      |                              ;
Language: C++

#include<stdio.h>

enum op_list{
    +
}
int main(){
    int x,y,op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
        if(op == "+"){
            printf("%d"\n,x+y);
        } else if(op == "-"){
            printf("%d"\n,x-y);
        } else if(op == "*"){
            printf("%d"\n,x*y);
        } else if(op == "/"){
            printf("%d"\n,x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc:10:24: error: stray '\' in program
   10 |             printf("%d"\n,x+y);
      |                        ^
a.cc:12:24: error: stray '\' in program
   12 |             printf("%d"\n,x-y);
      |                        ^
a.cc:14:24: error: stray '\' in program
   14 |             printf("%d"\n,x*y);
      |                        ^
a.cc:16:24: error: stray '\' in program
   16 |             printf("%d"\n,x/y);
      |                        ^
a.cc:4:5: error: expected identifier before '+' token
    4 |     +
      |     ^
a.cc:4:5: error: expected '}' before '+' token
a.cc:3:13: note: to match this '{'
    3 | enum op_list{
      |             ^
a.cc:4:5: error: expected unqualified-id before '+' token
    4 |     +
      |     ^
a.cc:5:1: error: expected declaration before '}' token
    5 | }
      | ^
a.cc: In function 'int main()':
a.cc:8:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
      |                                          ~~~^~~~~~
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:10:24: error: expected ')' before 'n'
   10 |             printf("%d"\n,x+y);
      |                   ~    ^~
      |                        )
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:12:24: error: expected ')' before 'n'
   12 |             printf("%d"\n,x-y);
      |                   ~    ^~
      |                        )
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:14:24: error: expected ')' before 'n'
   14 |             printf("%d"\n,x*y);
      |                   ~    ^~
      |                        )
a.cc:15:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         } else if(op == "/"){
      |                   ~~~^~~~~~
a.cc:16:24: error: expected ')' before 'n'
   16 |             printf("%d"\n,x/y);
      |                   ~    ^~
      |                        )
Language: C++

#include<stdio.h>

enum op_list{
    +
}
int main(){
    int x,y,op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
        if(op == "+"){
            printf("%d\n",x+y);
        } else if(op == "-"){
            printf("%d\n",x-y);
        } else if(op == "*"){
            printf("%d\n",x*y);
        } else if(op == "/"){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc:4:5: error: expected identifier before '+' token
    4 |     +
      |     ^
a.cc:4:5: error: expected '}' before '+' token
a.cc:3:13: note: to match this '{'
    3 | enum op_list{
      |             ^
a.cc:4:5: error: expected unqualified-id before '+' token
    4 |     +
      |     ^
a.cc:5:1: error: expected declaration before '}' token
    5 | }
      | ^
a.cc: In function 'int main()':
a.cc:8:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
      |                                          ~~~^~~~~~
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:15:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         } else if(op == "/"){
      |                   ~~~^~~~~~
Language: C++

#include<stdio.h>

int main(){
    int x,y,op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
        if(op == "+"){
            printf("%d\n",x+y);
        } else if(op == "-"){
            printf("%d\n",x-y);
        } else if(op == "*"){
            printf("%d\n",x*y);
        } else if(op == "/"){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    5 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
      |                                          ~~~^~~~~~
a.cc:6:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:8:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:10:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:12:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         } else if(op == "/"){
      |                   ~~~^~~~~~
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
        if(op == "+"){
            printf("%d\n",x+y);
        } else if(op == "-"){
            printf("%d\n",x-y);
        } else if(op == "*"){
            printf("%d\n",x*y);
        } else if(op == "/"){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
      |                                          ~~~^~~~~~
a.cc:7:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         } else if(op == "/"){
      |                   ~~~^~~~~~
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){
      |                                          ~~~^~~~~~
a.cc:9:2: error: expected '}' at end of input
    9 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y)){

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:2: error: expected '}' at end of input
    9 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op != "?"){}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op != "?"){}
      |                                          ~~~^~~~~~
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op !='?''){
        if(op == "+"){
            printf("%d\n",x+y);
        } else if(op == "-"){
            printf("%d\n",x-y);
        } else if(op == "*"){
            printf("%d\n",x*y);
        } else if(op == "/"){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc:6:50: warning: missing terminating ' character
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op !='?''){
      |                                                  ^
a.cc:6:50: error: missing terminating ' character
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op !='?''){
      |                                                  ^~~
a.cc: In function 'int main()':
a.cc:6:50: error: expected ')' before 'if'
    6 |     while(scanf("%d %c %d",&x,&op,&y) && op !='?''){
      |          ~                                       ^
      |                                                  )
    7 |         if(op == "+"){
      |         ~~                                        
a.cc:7:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         } else if(op == "/"){
      |                   ~~~^~~~~~
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'return'
   17 |     return 0;
      |     ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op !='?'){
        if(op == "+"){
            printf("%d\n",x+y);
        } else if(op == "-"){
            printf("%d\n",x-y);
        } else if(op == "*"){
            printf("%d\n",x*y);
        } else if(op == "/"){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(op == "+"){
      |            ~~~^~~~~~
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         } else if(op == "-"){
      |                   ~~~^~~~~~
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         } else if(op == "*"){
      |                   ~~~^~~~~~
a.cc:13:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         } else if(op == "/"){
      |                   ~~~^~~~~~
Language: C++

#include<stdio.h>

int main(){
    int x,y;
    char op;
    while(scanf("%d %c %d",&x,&op,&y) && op !='?'){
        if(op == '+'){
            printf("%d\n",x+y);
        } else if(op == '-''){
            printf("%d\n",x-y);
        } else if(op == '*'){
            printf("%d\n",x*y);
        } else if(op == '/''){
            printf("%d\n",x/y);
        }
    }
    return 0;
}


Compiler output:
a.cc:9:28: warning: missing terminating ' character
    9 |         } else if(op == '-''){
      |                            ^
a.cc:9:28: error: missing terminating ' character
    9 |         } else if(op == '-''){
      |                            ^~~
a.cc:13:28: warning: missing terminating ' character
   13 |         } else if(op == '/''){
      |                            ^
a.cc:13:28: error: missing terminating ' character
   13 |         } else if(op == '/''){
      |                            ^~~
a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before 'printf'
    9 |         } else if(op == '-''){
      |                            ^
      |                            ;
   10 |             printf("%d\n",x-y);
      |             ~~~~~~          
a.cc:11:9: error: expected primary-expression before '}' token
   11 |         } else if(op == '*'){
      |         ^
a.cc:10:32: error: expected ')' before '}' token
   10 |             printf("%d\n",x-y);
      |                                ^
      |                                )
   11 |         } else if(op == '*'){
      |         ~                       
a.cc:9:18: note: to match this '('
    9 |         } else if(op == '-''){
      |                  ^
a.cc:11:9: error: expected primary-expression before '}' token
   11 |         } else if(op == '*'){
      |         ^
a.cc:11:11: error: 'else' without a previous 'if'
   11 |         } else if(op == '*'){
      |           ^~~~
a.cc:13:28: error: expected ';' before 'printf'
   13 |         } else if(op == '/''){
      |                            ^
      |                            ;
   14 |             printf("%d\n",x/y);
      |             ~~~~~~          
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:14:32: error: expected ')' before '}' token
   14 |             printf("%d\n",x/y);
      |                                ^
      |                                )
   15 |         }
      |         ~                       
a.cc:13:18: note: to match this '('
   13 |         } else if(op == '/''){
      |                  ^
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc: At global scope:
a.cc:16:5: error: expected declaration before '}' token
   16 |     }
      |     ^
a.cc:17:5: error: expected unqualified-id before 'return'
   17 |     return 0;
      |     ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,result;
    char op;
    
    while(1){
        cin >> a >> op >> b;
        if(op=="?"){
            break;
        }else if(op == "+"){
            cout << a+b << endl;
        }else if(op == "-"){
            cout << a-b << endl;
        }else if(op == "*"){
            cout << a*b << endl;
        }else if(op == "/"){
            cout << a/b << endl;
        }
        
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(op=="?"){
      |            ~~^~~~~
a.cc:11:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         }else if(op == "+"){
      |                  ~~~^~~~~~
a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         }else if(op == "-"){
      |                  ~~~^~~~~~
a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         }else if(op == "*"){
      |                  ~~~^~~~~~
a.cc:17:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         }else if(op == "/"){
      |                  ~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main() {
    int a, b;
    char op;
    while (1) {
        cin >> a >> op >> b;
        if (op == "+") {
            cout << a+b << endl;
        } else if (op == "-") {
            cout << a-b << endl;
        } else if (op == "*") {
            cout << a*b << endl;
        } else if (op == "/") {
            cout << a/b << endl;
        } else {
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if (op == "+") {
      |             ~~~^~~~~~
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         } else if (op == "-") {
      |                    ~~~^~~~~~
a.cc:12:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         } else if (op == "*") {
      |                    ~~~^~~~~~
a.cc:14:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         } else if (op == "/") {
      |                    ~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,result;
    char op;
    
    while(1){
        cin >> a >> op >> b;
        if(op=='?'){
            break;
        }else if(op == '+'){
            cout << a+b << endl;
        }else if(op == '-'){
            cout << a-b << endl;
        }else if(op == '*'){
            cout << a*b << endl;
        }else if(op == '/''){
            cout << a/b << endl;
        }
        
    }
    
    return 0;
}


Compiler output:
a.cc:17:27: warning: missing terminating ' character
   17 |         }else if(op == '/''){
      |                           ^
a.cc:17:27: error: missing terminating ' character
   17 |         }else if(op == '/''){
      |                           ^~~
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before 'cout'
   17 |         }else if(op == '/''){
      |                           ^
      |                           ;
   18 |             cout << a/b << endl;
      |             ~~~~           
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
a.cc:18:33: error: expected ')' before '}' token
   18 |             cout << a/b << endl;
      |                                 ^
      |                                 )
   19 |         }
      |         ~                        
a.cc:17:17: note: to match this '('
   17 |         }else if(op == '/''){
      |                 ^
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
a.cc: At global scope:
a.cc:23:5: error: expected unqualified-id before 'return'
   23 |     return 0;
      |     ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
    int a, b;
    char op;
    while (1) {
        cin >> a >> op >> b;
        if (op = "+") {
            cout << a+b << endl;
        } else if (op = "-") {
            cout << a-b << endl;
        } else if (op = "*") {
            cout << a*b << endl;
        } else if (op = "/") {
            cout << a/b << endl;
        } else {
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    8 |         if (op = "+") {
      |                  ^~~
      |                  |
      |                  const char*
a.cc:10:25: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   10 |         } else if (op = "-") {
      |                         ^~~
      |                         |
      |                         const char*
a.cc:12:25: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |         } else if (op = "*") {
      |                         ^~~
      |                         |
      |                         const char*
a.cc:14:25: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   14 |         } else if (op = "/") {
      |                         ^~~
      |                         |
      |                         const char*
Language: C++

#include<iostream>
using namespace std;
int main() {
    int a, b;
    string op;
    while (1) {
        cin >> a >> op >> b;
        if (op = "+") {
            cout << a+b << endl;
        } else if (op = "-") {
            cout << a-b << endl;
        } else if (op = "*") {
            cout << a*b << endl;
        } else if (op = "/") {
            cout << a/b << endl;
        } else {
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |         if (op = "+") {
      |             ~~~^~~~~
      |                |
      |                std::__cxx11::basic_string<char>
a.cc:10:23: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"-"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   10 |         } else if (op = "-") {
      |                    ~~~^~~~~
      |                       |
      |                       std::__cxx11::basic_string<char>
a.cc:12:23: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"*"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |         } else if (op = "*") {
      |                    ~~~^~~~~
      |                       |
      |                       std::__cxx11::basic_string<char>
a.cc:14:23: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"/"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   14 |         } else if (op = "/") {
      |                    ~~~^~~~~
      |                       |
      |                       std::__cxx11::basic_string<char>
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,result;
    char op;
    
    while(1){
        cin >> a >> op >> b;
        if(op == "?")break;
        else if (op == "+"){
            cout << a + b << endl;
        }
        else if (op == "-"){
            cout << a-b <<endl;
        }
        else if (op == "*"){
            cout << a*b <<endl;
        }
        else if (op == "/"){
            cout << a/b <<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if(op == "?")break;
      |            ~~~^~~~~~
a.cc:10:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         else if (op == "+"){
      |                  ~~~^~~~~~
a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         else if (op == "-"){
      |                  ~~~^~~~~~
a.cc:16:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         else if (op == "*"){
      |                  ~~~^~~~~~
a.cc:19:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |         else if (op == "/"){
      |                  ~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,result;
    char op;
    
    while(1){
        cin >> a >> op >> b;
        if(op == '?'')break;
        else if (op == '+'){
            cout << a+b << endl;
        }
        else if (op == '-'){
            cout << a-b <<endl;
        }
        else if (op == '*'){
            cout << a*b <<endl;
        }
        else if (op == '/'){
            cout << a/b <<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:9:21: warning: missing terminating ' character
    9 |         if(op == '?'')break;
      |                     ^
a.cc:9:21: error: missing terminating ' character
    9 |         if(op == '?'')break;
      |                     ^~~~~~~~
a.cc: In function 'int main()':
a.cc:9:21: error: expected ')' before 'else'
    9 |         if(op == '?'')break;
      |           ~         ^
      |                     )
   10 |         else if (op == '+'){
      |         ~~~~         
a.cc:22:5: error: expected primary-expression before '}' token
   22 |     }
      |     ^
Language: C++

#include<iostream>
#include<math.h>
int main(){
int a,b,K;
char op;
while(1){
cin>>a>>op>>b;
if (op=="?") break;
if (op=="+") cin<<a+b<<endl;
else(op=="-") cin<<a-b<<endl;
else(op=="*") cin<<a*b<<endl;
else(op=="/") cin<<a/b<<endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin>>a>>op>>b;
      | ^~~
      | 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:8:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if (op=="?") break;
      |     ~~^~~~~
a.cc:9:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 | if (op=="+") cin<<a+b<<endl;
      |     ~~^~~~~
a.cc:9:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 | if (op=="+") cin<<a+b<<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:10:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 | else(op=="-") cin<<a-b<<endl;
      |      ~~^~~~~
a.cc:10:14: error: expected ';' before 'cin'
   10 | else(op=="-") cin<<a-b<<endl;
      |              ^~~~
      |              ;
a.cc:11:1: error: 'else' without a previous 'if'
   11 | else(op=="*") cin<<a*b<<endl;
      | ^~~~
a.cc:11:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | else(op=="*") cin<<a*b<<endl;
      |      ~~^~~~~
a.cc:11:14: error: expected ';' before 'cin'
   11 | else(op=="*") cin<<a*b<<endl;
      |              ^~~~
      |              ;
a.cc:12:1: error: 'else' without a previous 'if'
   12 | else(op=="/") cin<<a/b<<endl;
      | ^~~~
a.cc:12:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | else(op=="/") cin<<a/b<<endl;
      |      ~~^~~~~
a.cc:12:14: error: expected ';' before 'cin'
   12 | else(op=="/") cin<<a/b<<endl;
      |              ^~~~
      |              ;
Language: C++

#include<iostream>
#include<math.h>
int main(){
int a,b,K;
char op;
while(1){
cin>>a>>op>>b;
if (op=="?") break;
if (op=="+") cin<<a+b<<endl;
else if(op=="-") cin<<a-b<<endl;
else if(op=="*") cin<<a*b<<endl;
else if(op=="/") cin<<a/b<<endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin>>a>>op>>b;
      | ^~~
      | 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:8:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if (op=="?") break;
      |     ~~^~~~~
a.cc:9:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 | if (op=="+") cin<<a+b<<endl;
      |     ~~^~~~~
a.cc:9:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 | if (op=="+") cin<<a+b<<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:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 | else if(op=="-") cin<<a-b<<endl;
      |         ~~^~~~~
a.cc:10:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 | else if(op=="-") cin<<a-b<<endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | else if(op=="*") cin<<a*b<<endl;
      |         ~~^~~~~
a.cc:11:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 | else if(op=="*") cin<<a*b<<endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | else if(op=="/") cin<<a/b<<endl;
      |         ~~^~~~~
a.cc:12:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 | else if(op=="/") cin<<a/b<<endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<math.h>
int main(){
    int a,b,K;
    char op;
    while(1){
        cin>>a>>op>>b;
        if (op=="?") break;
        if (op=="+") cin<<a+b<<endl;
        else if(op=="-") cin<<a-b<<endl;
        else if(op=="*") cin<<a*b<<endl;
        else if(op=="/") cin<<a/b<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>a>>op>>b;
      |         ^~~
      |         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:8:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if (op=="?") break;
      |             ~~^~~~~
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if (op=="+") cin<<a+b<<endl;
      |             ~~^~~~~
a.cc:9:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         if (op=="+") cin<<a+b<<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:10:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         else if(op=="-") cin<<a-b<<endl;
      |                 ~~^~~~~
a.cc:10:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |         else if(op=="-") cin<<a-b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         else if(op=="*") cin<<a*b<<endl;
      |                 ~~^~~~~
a.cc:11:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |         else if(op=="*") cin<<a*b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         else if(op=="/") cin<<a/b<<endl;
      |                 ~~^~~~~
a.cc:12:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         else if(op=="/") cin<<a/b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<math.h>
int main(){
    int a,b,K;
    char op;
    while(1){
        cin>>a>>op>>b;
        if (op=='?') break;
        if (op='+') cin<<a+b<<endl;
        else if(op=='-') cin<<a-b<<endl;
        else if(op=='*') cin<<a*b<<endl;
        else if(op=='/') cin<<a/b<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>a>>op>>b;
      |         ^~~
      |         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:9:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         if (op='+') cin<<a+b<<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:10:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |         else if(op=='-') cin<<a-b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |         else if(op=='*') cin<<a*b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         else if(op=='/') cin<<a/b<<endl;
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,K;
    char op;
    while(1){
        cin>>a>>op>>b;
        if (op=='?') break;
        if (op='+') cout<<a+b<<endl;
        else (op=='-') cout<<a-b<<endl;
        else (op=='*') cout<<a*b<<endl;
        else (op=='/') cout<<a/b<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected ';' before 'cout'
   10 |         else (op=='-') cout<<a-b<<endl;
      |                       ^~~~~
      |                       ;
a.cc:11:9: error: 'else' without a previous 'if'
   11 |         else (op=='*') cout<<a*b<<endl;
      |         ^~~~
a.cc:11:23: error: expected ';' before 'cout'
   11 |         else (op=='*') cout<<a*b<<endl;
      |                       ^~~~~
      |                       ;
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else (op=='/') cout<<a/b<<endl;
      |         ^~~~
a.cc:12:23: error: expected ';' before 'cout'
   12 |         else (op=='/') cout<<a/b<<endl;
      |                       ^~~~~
      |                       ;