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

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

int main(){
    int a, b; char op;
    cin >> a >> op >> c;
    while(true){
        if(op == '?') break;
        int ans;
        if(op == '+') ans = a + b;
        if(op == '-') ans = a - b;
        if(op == '*') ans = a * b;
        if(op == '/') ans = a / b;
        cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'c' was not declared in this scope
    6 |     cin >> a >> op >> c;
      |                       ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
    int a, b; char op;
    cin >> a >> op >> b;
    while(true){
        if(op == '?') break;
        int ans;
        if(op == '+') ans = a + b;
        if(op == '-') ans = a - b;
        if(op == '*') ans = a * b;
        if(op == '/') ans = a / b;
        cout << ans << endl;
}


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

#include<stdio.h>
int main(){

int a,b;
char op;

whlile(scanf("%d%c%d",&a,&op,&b),op!='?'){


if(op=='+')printf("%d\n",a+b);
if(op=='-')printf("%d\n",a-b);
if(op=='*')printf("%d\n",a*b);
if(op=='/')printf("%d\n",a/b);

}

return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'whlile' was not declared in this scope
    7 | whlile(scanf("%d%c%d",&a,&op,&b),op!='?'){
      | ^~~~~~
Language: C++

int main(void)
{
	int a,b,i,n;
	char op;
	while(1){
		scanf("%d %c %d",&a,&op,&b);
		if(op=='?') break;
		if(op=='+'){
			n=a+b;
			printf("%d\n",n);
		}
		if(op=='-'){
			n=a-b;
			printf("%d\n",n);
		}
		if(op=='*'){
			n=a*b;
			printf("%d\n",n);
		}	
		if(op=='/'){
			n=a/b;
			printf("%d\n",n);
		}
	}
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'scanf' was not declared in this scope
    6 |                 scanf("%d %c %d",&a,&op,&b);
      |                 ^~~~~
a.cc:10:25: error: 'printf' was not declared in this scope
   10 |                         printf("%d\n",n);
      |                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:14:25: error: 'printf' was not declared in this scope
   14 |                         printf("%d\n",n);
      |                         ^~~~~~
a.cc:14:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:18:25: error: 'printf' was not declared in this scope
   18 |                         printf("%d\n",n);
      |                         ^~~~~~
a.cc:18:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:22:25: error: 'printf' was not declared in this scope
   22 |                         printf("%d\n",n);
      |                         ^~~~~~
a.cc:22:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main(void){
    int a,b;
    string op;
    
    
    for(int i=0;i>1;i=0){
        
        cin>>a;
        cin>>op:
        cin>>b;
        
        if(op=="+"){
            cout<<a+b<<endl;
        }
        
        if(op=="-"){
            cout<<a-b<<endl;
        }
        
        if(op=="*"){
            cout<<a*b<<endl;
        }
        
        if(op=="/"){
            cout<<a/b<<endl;
        }
        
        if(op=="?"){
            i=2;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: found ':' in nested-name-specifier, expected '::'
   12 |         cin>>op:
      |                ^
      |                ::
a.cc:12:14: error: 'op' is not a class, namespace, or enumeration
   12 |         cin>>op:
      |              ^~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'i1' was not declared in this scope; did you mean 'i'?
    7 |     for(int i=0;i1;i=i+0){
      |                 ^~
      |                 i
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before 'if'
    8 |   cin >> a >> op >> b
      |                      ^
      |                      ;
    9 |   if(op == '?') break;
      |   ~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before 'if'
    8 |   cin >> a >> op >> b
      |                      ^
      |                      ;
    9 |   if(op == '?') break;
      |   ~~                  
a.cc:12:6: error: 'elseif' was not declared in this scope
   12 |     }elseif(op == '-'){
      |      ^~~~~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: 'elseif' was not declared in this scope
   12 |     }elseif(op == '-'){
      |      ^~~~~~
Language: C++

#include <stdio.h>

int main(void)
{
	int a, b, op, x;
	while(1)
	{
	scanf("%d %c %d", &a, &op, &b);
	if(op==?)
		{
			break;
		}
	x=aopb;
	printf("%d\n", x);
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected primary-expression before '?' token
    9 |         if(op==?)
      |                ^
a.cc:9:17: error: expected primary-expression before ')' token
    9 |         if(op==?)
      |                 ^
a.cc:9:17: error: expected ':' before ')' token
    9 |         if(op==?)
      |                 ^
      |                 :
a.cc:9:17: error: expected primary-expression before ')' token
a.cc:13:11: error: 'aopb' was not declared in this scope; did you mean 'op'?
   13 |         x=aopb;
      |           ^~~~
      |           op
Language: C++

#include <stdio.h>
int main (void)
{
  int a,b,op;
  scanf("%d %d %d",&a,&b,&op);
  for ( ; ; ){
    if (op == ?){break;}
    if (op == +){printf("%d\n",a + b)}
    if (op == -){printf("%d\n",a - b)}
    if (op == *){printf("%d\n",a * b)}
    if (op == /){printf("%d\n",a / b)}
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '?' token
    7 |     if (op == ?){break;}
      |               ^
a.cc:7:16: error: expected primary-expression before ')' token
    7 |     if (op == ?){break;}
      |                ^
a.cc:7:16: error: expected ':' before ')' token
    7 |     if (op == ?){break;}
      |                ^
      |                :
a.cc:7:16: error: expected primary-expression before ')' token
a.cc:8:16: error: expected primary-expression before ')' token
    8 |     if (op == +){printf("%d\n",a + b)}
      |                ^
a.cc:8:38: error: expected ';' before '}' token
    8 |     if (op == +){printf("%d\n",a + b)}
      |                                      ^
      |                                      ;
a.cc:9:16: error: expected primary-expression before ')' token
    9 |     if (op == -){printf("%d\n",a - b)}
      |                ^
a.cc:9:38: error: expected ';' before '}' token
    9 |     if (op == -){printf("%d\n",a - b)}
      |                                      ^
      |                                      ;
a.cc:10:16: error: expected primary-expression before ')' token
   10 |     if (op == *){printf("%d\n",a * b)}
      |                ^
a.cc:10:38: error: expected ';' before '}' token
   10 |     if (op == *){printf("%d\n",a * b)}
      |                                      ^
      |                                      ;
a.cc:11:15: error: expected primary-expression before '/' token
   11 |     if (op == /){printf("%d\n",a / b)}
      |               ^
a.cc:11:16: error: expected primary-expression before ')' token
   11 |     if (op == /){printf("%d\n",a / b)}
      |                ^
a.cc:11:38: error: expected ';' before '}' token
   11 |     if (op == /){printf("%d\n",a / b)}
      |                                      ^
      |                                      ;
Language: C++


#include <stdio.h>
int main (void)
{
  int a,b,k;
  char op;
  while (){
  scanf("%d %c %d",&a,&op,&b);
    if (op == '+'){k = a + b;}
    else if (op == '-'){k = a - b;}
    else if (op == '*'){k = a * b;}
    else if (op == '/'){k = a / b;}
    else {break;}
    printf("%d\n",k);
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected primary-expression before ')' token
    7 |   while (){
      |          ^
Language: C++

#include <stdio.h>
int main (void)
{
  int a,b,k;
  char op;
  while ()
  {
  scanf("%d %c %d",&a,&op,&b);
    if (op == '+'){k = a + b;}
    else if (op == '-'){k = a - b;}
    else if (op == '*'){k = a * b;}
    else if (op == '/'){k = a / b;}
    else {break;}
    printf("%d\n",k);
  }
}
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected primary-expression before ')' token
    6 |   while ()
      |          ^
a.cc: At global scope:
a.cc:17:3: 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 (void)
{
  int a,b,k;
  char op;
  for( ; ; ) {
    scanf("%d %c %d",&a,&op,&b);
    if (op == '+'){k = a + b;}
    else if (op == '-'){k = a - b;}
    else if (op == '*'){k = a * b;}
    else if (op == '/'){k = a / b;}
    else {break;}
    printf("%d\n",k);
  }
}
  return 0;
}




Compiler output:
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

int main(void){
    int a,b;
    char op;
    cin >> a >> op >> b;
    while(op!='?'){
switch (op){
    case'+':
    cout << a+b << endl;
    break;
    case'-':
    cout << a-b << endl;
    break;
    case'*':
    cout << a*b << endl;
    break;
    case'/' :
    cout << a/b << endl;
    break;
} 
cin >> a >> op >> b;}
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> a >> op >> b;
      |     ^~~
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << a+b << endl;
      |     ^~~~
a.cc:8:20: error: 'endl' was not declared in this scope
    8 |     cout << a+b << endl;
      |                    ^~~~
Language: C++

a, op, b = input().split()

if(op == '+'):
     print(int(a) + int(b))
elif(op == '-'):
    print(int(a) - int(b))
elif(op == '*'):
    print(int(a) * int(b))
elif(op == '/'):
    print(int(a) / float(b))


Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a, op, b = input().split()
      | ^
Language: C++

while(True):
    a, op, b = input().split()

    if(op == '+'):
        print(int(a) + int(b))
    elif(op == '-'):
        print(int(a) - int(b))
    elif(op == '*'):
        print(int(a) * int(b))
    elif(op == '/'):
        print(int(a) // int(b))
    else:
        break


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while(True):
      | ^~~~~
Language: C++

#include <iostream>#include <stdio.h>using namespace std;int main(void){     int a,b;     char op;     cin>>a>>op>>b;     while(op; !='?')break;{     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:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>#include <stdio.h>using namespace std;int main(void){     int a,b;     char op;     cin>>a>>op>>b;     while(op; !='?')break;{     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;}
      |                    ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;
int main(void){
     int a,b;     
     char op;    
     cin>>a>>op>>b;    
while(op=0; !='?')break;{     
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:7:11: error: expected ')' before ';' token
    7 | while(op=0; !='?')break;{
      |      ~    ^
      |           )
a.cc:7:13: error: expected primary-expression before '!=' token
    7 | while(op=0; !='?')break;{
      |             ^~
Language: C++

#include<iostream>

using namespace std;

int main() {
    int a,b;
    char c;
    cin >> a >> b >> c;
    switch(c){
        case(?) break;
        case(+) cout << a+b;
        case(-) cout << a-b;
        case(*) cout << a*b;
        case(/) cout << a/b;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected primary-expression before '?' token
   10 |         case(?) break;
      |              ^
a.cc:10:15: error: expected primary-expression before ')' token
   10 |         case(?) break;
      |               ^
a.cc:10:15: error: expected ':' before ')' token
   10 |         case(?) break;
      |               ^
      |               :
a.cc:10:15: error: expected primary-expression before ')' token
a.cc:10:16: error: expected ':' before 'break'
   10 |         case(?) break;
      |                ^~~~~~
      |                :
a.cc:11:15: error: expected primary-expression before ')' token
   11 |         case(+) cout << a+b;
      |               ^
a.cc:11:16: error: expected ':' before 'cout'
   11 |         case(+) cout << a+b;
      |                ^~~~~
      |                :
a.cc:12:15: error: expected primary-expression before ')' token
   12 |         case(-) cout << a-b;
      |               ^
a.cc:12:16: error: expected ':' before 'cout'
   12 |         case(-) cout << a-b;
      |                ^~~~~
      |                :
a.cc:13:15: error: expected primary-expression before ')' token
   13 |         case(*) cout << a*b;
      |               ^
a.cc:13:16: error: expected ':' before 'cout'
   13 |         case(*) cout << a*b;
      |                ^~~~~
      |                :
a.cc:14:14: error: expected primary-expression before '/' token
   14 |         case(/) cout << a/b;
      |              ^
a.cc:14:15: error: expected primary-expression before ')' token
   14 |         case(/) cout << a/b;
      |               ^
a.cc:14:16: error: expected ':' before 'cout'
   14 |         case(/) cout << a/b;
      |                ^~~~~
      |                :
Language: C++

#include<iostream>

using namespace std;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    switch(c){
        case(?) break;
        case(+) cout << a+b;
        case(-) cout << a-b;
        case(*) cout << a*b;
        case(/) cout << a/b;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected primary-expression before '?' token
    9 |         case(?) break;
      |              ^
a.cc:9:15: error: expected primary-expression before ')' token
    9 |         case(?) break;
      |               ^
a.cc:9:15: error: expected ':' before ')' token
    9 |         case(?) break;
      |               ^
      |               :
a.cc:9:15: error: expected primary-expression before ')' token
a.cc:9:16: error: expected ':' before 'break'
    9 |         case(?) break;
      |                ^~~~~~
      |                :
a.cc:10:15: error: expected primary-expression before ')' token
   10 |         case(+) cout << a+b;
      |               ^
a.cc:10:16: error: expected ':' before 'cout'
   10 |         case(+) cout << a+b;
      |                ^~~~~
      |                :
a.cc:11:15: error: expected primary-expression before ')' token
   11 |         case(-) cout << a-b;
      |               ^
a.cc:11:16: error: expected ':' before 'cout'
   11 |         case(-) cout << a-b;
      |                ^~~~~
      |                :
a.cc:12:15: error: expected primary-expression before ')' token
   12 |         case(*) cout << a*b;
      |               ^
a.cc:12:16: error: expected ':' before 'cout'
   12 |         case(*) cout << a*b;
      |                ^~~~~
      |                :
a.cc:13:14: error: expected primary-expression before '/' token
   13 |         case(/) cout << a/b;
      |              ^
a.cc:13:15: error: expected primary-expression before ')' token
   13 |         case(/) cout << a/b;
      |               ^
a.cc:13:16: error: expected ':' before 'cout'
   13 |         case(/) cout << a/b;
      |                ^~~~~
      |                :
Language: C++

#include<iostream>

using namespace std;

int main() {
    int a,b;
    char c;
    cin >> a >> b >> c;
    switch(c){
        case("?") break;
        case("+") cout << a+b;
        case("-") cout << a-b;
        case("*") cout << a*b;
        case("/") cout << a/b;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   10 |         case("?") break;
      |             ~^~~~
a.cc:10:14: error: could not convert '("?")' from 'const char [2]' to 'int'
   10 |         case("?") break;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:10:18: error: expected ':' before 'break'
   10 |         case("?") break;
      |                  ^~~~~~
      |                  :
a.cc:11:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   11 |         case("+") cout << a+b;
      |             ~^~~~
a.cc:11:14: error: could not convert '("+")' from 'const char [2]' to 'int'
   11 |         case("+") cout << a+b;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:11:18: error: expected ':' before 'cout'
   11 |         case("+") cout << a+b;
      |                  ^~~~~
      |                  :
a.cc:12:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   12 |         case("-") cout << a-b;
      |             ~^~~~
a.cc:12:14: error: could not convert '("-")' from 'const char [2]' to 'int'
   12 |         case("-") cout << a-b;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:12:18: error: expected ':' before 'cout'
   12 |         case("-") cout << a-b;
      |                  ^~~~~
      |                  :
a.cc:13:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   13 |         case("*") cout << a*b;
      |             ~^~~~
a.cc:13:14: error: could not convert '("*")' from 'const char [2]' to 'int'
   13 |         case("*") cout << a*b;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:13:18: error: expected ':' before 'cout'
   13 |         case("*") cout << a*b;
      |                  ^~~~~
      |                  :
a.cc:14:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   14 |         case("/") cout << a/b;
      |             ~^~~~
a.cc:14:14: error: could not convert '("/")' from 'const char [2]' to 'int'
   14 |         case("/") cout << a/b;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:14:18: error: expected ':' before 'cout'
   14 |         case("/") cout << a/b;
      |                  ^~~~~
      |                  :
Language: C++

#include<iostream>

using namespace std;

int main() {
    int a,b;
    char c;
    while(1){
        switch(c){
            case'?' : break;
            case'+' : cout << a+b; break;
            case'-' : cout << a-b; break;
            case'*' : cout << a*b; break;
            case'/' : cout << a/b; break;
        }
    cout << endl;
    if(c == ?) break;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: expected primary-expression before '?' token
   17 |     if(c == ?) break;
      |             ^
a.cc:17:14: error: expected primary-expression before ')' token
   17 |     if(c == ?) break;
      |              ^
a.cc:17:14: error: expected ':' before ')' token
   17 |     if(c == ?) break;
      |              ^
      |              :
a.cc:17:14: error: expected primary-expression before ')' token
Language: C++

#include<stdio.h>

int n,m,res;
char op;

int main() {
 while(true){
  scanf("%d %c %d",&n,&op,&m):
  if(op=='?')break;
  switch(op){
   case '+': res=n+m;break;
   case '-': res=n-m;break;
   case '*': res=n*m;break;
   case '/': res=n/m;break;
  }
  printf("%d\n",res);
 }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: expected ';' before ':' token
    8 |   scanf("%d %c %d",&n,&op,&m):
      |                              ^
      |                              ;
Language: C++

#include <stdio.h>
int main(){
		int a,b,c,d;
		char op;
		scanf("%d %c %d",&a, &op, &b);
		while(true){
			if (op == + ){
		c = a+b;
		printf("%d",&c);
	}
			else if(op == - ){
		c = a-b;
		printf("%d",&c);
	}
			else if(op == * ){
		c = a*b;
		printf("%d",&c);
	}
			else if(op == / ){
		c = 10*a/b;
		d = c-(c%10);
		d = d/10 
		d = c;
		printf("%d",&c);
	}


		else {
		break;
	}

		}

	    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: expected primary-expression before ')' token
    7 |                         if (op == + ){
      |                                     ^
a.cc:11:41: error: expected primary-expression before ')' token
   11 |                         else if(op == - ){
      |                                         ^
a.cc:15:41: error: expected primary-expression before ')' token
   15 |                         else if(op == * ){
      |                                         ^
a.cc:19:39: error: expected primary-expression before '/' token
   19 |                         else if(op == / ){
      |                                       ^
a.cc:19:41: error: expected primary-expression before ')' token
   19 |                         else if(op == / ){
      |                                         ^
a.cc:22:25: error: expected ';' before 'd'
   22 |                 d = d/10
      |                         ^
      |                         ;
   23 |                 d = c;
      |                 ~
Language: C++

#include <stdio.h>
int main()
{
while(true)
{
char c;
int a, b;
scanf("%d %c %d", &a, &c, &b);
if( c == '?') break;
int ans = 0;
switch
{
case '+': ans = a+b; break;
case '-': ans = a-b; break;
case '*': ans = a*b; break;
case '/': ans = a/b; break;
}
printf("%d\n", ans);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: expected '(' before '{' token
   12 | {
      | ^
      | (
Language: C++

#include <iostream>
int main(void)
{
  while (1) {
    int a, b, r;
    char op;
    std::cin >> a >> op >> b;
    switch (op) {
    case '+':
      r = a + b;
      break;
    case '-':
      r = a - b;
      break;
    case '*':
      r = a * b;
      break;
    case '/':
      r = a / b;
      break;
    case '?':
      return;
    }
    std::cout << r << std::endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   22 |       return;
      |       ^~~~~~
Language: C++

#include<math.h>

using namespace std;

int main()
{
	int a,b;
	char op='\0';
	
	for( ; '?' != op ; ) {
		cin>>a>>op>>b;
		switch( op ) {
			case '+':
				cout <<a+b<<endl;
				break;
			case '-':
				cout <<a-b<<endl;
				break;
			case '*':
				cout <<a*b<<endl;
				break;
			case '/':
				cout <<a/b<<endl;
				break;
			case '?':
				;
				break;
		}
	}
		    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cin' was not declared in this scope
   11 |                 cin>>a>>op>>b;
      |                 ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<math.h>
  +++ |+#include <iostream>
    2 | 
a.cc:14:33: error: 'cout' was not declared in this scope
   14 |                                 cout <<a+b<<endl;
      |                                 ^~~~
a.cc:14:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:45: error: 'endl' was not declared in this scope
   14 |                                 cout <<a+b<<endl;
      |                                             ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<math.h>
  +++ |+#include <ostream>
    2 |
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'c' was not declared in this scope
    8 |     while(c != '?'){
      |           ^
Language: C++

#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    a, op, b = input().split()
    a, b = int(a), int(b)

    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    else:
        print(a / b)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:2:3: error: invalid preprocessing directive #-
    2 | # -*- coding: utf-8 -*-
      |   ^
a.cc:4:1: error: expected unqualified-id before 'while'
    4 | while True:
      | ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main () {
 
 int a,b;
 char k;
 
 cin >> a >> k >> b;

 switch (k) {
  case + : cout << a+b ; break;
  case - : cout << a-b ; break;
  case / : cout << a/b ; break;
  case * : cout << a*b ; break;
 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before ':' token
   12 |   case + : cout << a+b ; break;
      |          ^
a.cc:13:10: error: expected primary-expression before ':' token
   13 |   case - : cout << a-b ; break;
      |          ^
a.cc:14:8: error: expected primary-expression before '/' token
   14 |   case / : cout << a/b ; break;
      |        ^
a.cc:14:10: error: expected primary-expression before ':' token
   14 |   case / : cout << a/b ; break;
      |          ^
a.cc:15:10: error: expected primary-expression before ':' token
   15 |   case * : cout << a*b ; break;
      |          ^
Language: C++

#include <iostream>
using namespace std;

int main () {
 
 int a,b;
 char op;
 
 while (cin >> a >> op >> b) {
  if (op == ?) {
   break;
  }
  switch (op) {
   case '+' : cout << a+b ; break;
   case '-' : cout << a-b ; break;
   case '/' : cout << a/b ; break;
   case '*' : cout << a*b ; break;
  }
  cout << endl;
 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before '?' token
   10 |   if (op == ?) {
      |             ^
a.cc:10:14: error: expected primary-expression before ')' token
   10 |   if (op == ?) {
      |              ^
a.cc:10:14: error: expected ':' before ')' token
   10 |   if (op == ?) {
      |              ^
      |              :
a.cc:10:14: error: expected primary-expression before ')' token
Language: C++

#include <iostream>
using namespace std;

int main()
{
    int a, b;
    ch op;
    while (cin >> a >> op >> b, op != '?') {
        switch (op) {
            case '+':
                cout << a + b << '\n';
                break;
            case '-':
                cout << a - b << '\n';
                break;
            case '*':
                cout << a * b << '\n';
                break;
            case '/':
                cout << a / b << '\n';
                break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'ch' was not declared in this scope
    7 |     ch op;
      |     ^~
a.cc:8:24: error: 'op' was not declared in this scope
    8 |     while (cin >> a >> op >> b, op != '?') {
      |                        ^~
Language: C++

//simple caluculator

#include<iostream>
using namespace std;

int main()
{
int a,b;
char op;

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 if(op==?)

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: expected primary-expression before '?' token
   21 | else if(op==?)
      |             ^
a.cc:21:14: error: expected primary-expression before ')' token
   21 | else if(op==?)
      |              ^
a.cc:21:14: error: expected ':' before ')' token
   21 | else if(op==?)
      |              ^
      |              :
a.cc:21:14: error: expected primary-expression before ')' token
Language: C++

#include<cstdio>

int main(){
	int a, b;
	char op;
	while(1){
		scanf("%d %s %d", &a, &op, &b);
		if(op == ?) break;
		int n = a op b;
		printf("%d\n", n);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected primary-expression before '?' token
    8 |                 if(op == ?) break;
      |                          ^
a.cc:8:27: error: expected primary-expression before ')' token
    8 |                 if(op == ?) break;
      |                           ^
a.cc:8:27: error: expected ':' before ')' token
    8 |                 if(op == ?) break;
      |                           ^
      |                           :
a.cc:8:27: error: expected primary-expression before ')' token
a.cc:9:27: error: expected ',' or ';' before 'op'
    9 |                 int n = a op b;
      |                           ^~
Language: C++

#include<cstdio>

int main(){
	int a, b;
	char op;
	while(1){
		scanf("%d %c %d", &a, &op, &b);
		if(op == ?) break;
		int n = a op b;
		printf("%d\n", n);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected primary-expression before '?' token
    8 |                 if(op == ?) break;
      |                          ^
a.cc:8:27: error: expected primary-expression before ')' token
    8 |                 if(op == ?) break;
      |                           ^
a.cc:8:27: error: expected ':' before ')' token
    8 |                 if(op == ?) break;
      |                           ^
      |                           :
a.cc:8:27: error: expected primary-expression before ')' token
a.cc:9:27: error: expected ',' or ';' before 'op'
    9 |                 int n = a op b;
      |                           ^~
Language: C++

#include<cstdio>

int main(){
	int a, b, n;
	char op;
	while(1){
		scanf("%d %c %d", &a, &op, &b);
		if(op == "?") break;
		if(op == "+"){
			n=a+b;
		}else if(op == "-"){
			n=a-b;
		}else if(op == "*"){
			n=a*b;
		}else if(op == "/"){
			n=a/b;
		}
		printf("%d\n", n);
	}

	return 0;
}

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

#include<cstdio>

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

	return 0;
}

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

#include<cstdio>

int main(){
	int a, b, n;
	char op;
	while(op != "?"){
		scanf("%d %s %d", &a, &op, &b);
		if(op == "+"){
			n=a+b;
		}else if(op == "-"){
			n=a-b;
		}else if(op == "*"){
			n=a*b;
		}else if(op == "/"){
			n=a/b;
		}
		printf("%d\n", n);
	}

	return 0;
}

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

#include<cstdio>

int main(){
	int a, b, n;
	char op;
	while(op != "?"){
		scanf("%d %s %d", &a, op, &b);
		if(op == "+"){
			n=a+b;
		}else if(op == "-"){
			n=a-b;
		}else if(op == "*"){
			n=a*b;
		}else if(op == "/"){
			n=a/b;
		}
		printf("%d\n", n);
	}

	return 0;
}

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

#include<stdio.h>

int main(void)
{
	int a,b;
	char op;

	while(1){
		scanf("%d %c %d",&a,&op,&b);
		if(op=='+'){
			printf("%d\n",a+b);
		}
		else if(op=='-'){
			printf("%d\n",a-b);
		}
		else if(op=='*'){
			printf("%d\n",a*b);
		}
		else if(op=='/'){
			printf("%d\n",a/b);
		}
		else(op=='?'){
			break;
		}
	}
	return 0;
}

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

#include<stdio.h>

int main(void)
{
int a,b;
char op;

while(1){
scanf("%d %c %d"&a,&op,&b);
if(op=='+'){
printf("%d\n",a+b);
}
else if(op=='-'){
printf("%d\n",a-b);
}
else if(op=='*'){
printf("%d\n",a*b);
}
else if(op=='/'){
printf("%d\n",a/b);
}
else if(op=='?'){
break;
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: invalid operands of types 'const char [9]' and 'int' to binary 'operator&'
    9 | scanf("%d %c %d"&a,&op,&b);
      |       ~~~~~~~~~~^~
      |       |          |
      |       |          int
      |       const char [9]
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 if     (op=="+") c = a+b;
      |                         ~~^~~~~
a.cc:8:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |                 else if(op=="-") c = a-b;
      |                         ~~^~~~~
a.cc:9:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |                 else if(op=="*") c = a*b;
      |                         ~~^~~~~
a.cc:10:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 else if(op=="/") c = a/b;
      |                         ~~^~~~~
a.cc:11:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 else if(op=="?") return 0;
      |                         ~~^~~~~
Language: C++

#include<cstdio>
int main(){
	int a,op,b,y;
	scanf("%d %d %d",&a,&op,&b);
	if(op == '+'){
	y = a+b;
	}
	if(op == '-'){
	y = a-b;
	}
	if(op == '*'){
	y = a*b;
	}
	if(op == '/'){
	y = a/b;
	}
	if(op == '?') break;
	printf("%d",y);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: break statement not within loop or switch
   17 |         if(op == '?') break;
      |                       ^~~~~
Language: C++

#include<stdio.h>
int main()
{
	int a,b;
	char op;
	for(i=1;;i++)
	{
		scanf("%d %c %d",&a,&op,&b);
		if(op=='?')break;
		if(op=='+') printf("%d\n",a+b);
		if(op=='-') printf("%d\n",a-b);
		if(op=='*') printf("%d\n",a*b);
		if(op=='/') printf("%d\n",a/b);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         for(i=1;;i++)
      |             ^
Language: C++

#include<iostream>
using namespace

int main(){

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

while( z != ? ){

cout << x z y << endl;

return 0 ;

}

Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
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 >> x >> y >> z;
      | ^~~
      | 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:13: error: expected primary-expression before '?' token
    9 | while( z != ? ){
      |             ^
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:9:14: error: expected ':' before ')' token
    9 | while( z != ? ){
      |              ^~
      |              :
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << x z 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:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace

int main(){

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

while( z != ? ){

cout << x z y << endl;

}

return 0 ;

}

Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
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 >> x >> y >> z;
      | ^~~
      | 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:13: error: expected primary-expression before '?' token
    9 | while( z != ? ){
      |             ^
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:9:14: error: expected ':' before ')' token
    9 | while( z != ? ){
      |              ^~
      |              :
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << x z y << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
using namespace
 
int main(){
 
int x , y , z;
cin >> x >> y >> z;
 
while( z != ? ){
 
cout << "x " << "z " <<  "y" << endl;
 
}
 
return 0 ;
 
}

Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
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 >> x >> y >> z;
      | ^~~
      | 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:13: error: expected primary-expression before '?' token
    9 | while( z != ? ){
      |             ^
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:9:14: error: expected ':' before ')' token
    9 | while( z != ? ){
      |              ^~
      |              :
a.cc:9:15: error: expected primary-expression before ')' token
    9 | while( z != ? ){
      |               ^
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << "x " << "z " <<  "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:11:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 | cout << "x " << "z " <<  "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)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;


int main(){

int x  , y;
char op;

while(1){
cin >> x >>  op  >> y;
if( op == '?' ) break;

if ( op == '+' ) cout << x + y << endl;
if ( op == '-' ) cout << x - y << endl;
if ( op == '*' ) cout << x * y << endl;
if ( op == '/' ) cout << x / y << endl:
}
return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:39: error: expected ';' before ':' token
   17 | if ( op == '/' ) cout << x / y << endl:
      |                                       ^
      |                                       ;
Language: C++

#include<iostream>
using namespace std;

int main(){

int x  , y;
char op;

while(1){
cin >> x >>  op  >> y;
if( op == '?' ) break;

if ( op == '+' ) cout << x + y << endl;
else if ( op == '-' ) cout << x - y << endl;
else if ( op == '*' ) cout << x * y << endl;
else if ( op == '/' ) cout << x / y << endl:
}
return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:44: error: expected ';' before ':' token
   16 | else if ( op == '/' ) cout << x / y << endl:
      |                                            ^
      |                                            ;
Language: C++

#include<iostream>
using namespace std;

int main(){
int x  , y;
char op;
 
while(1){
cin >> x >>  op  >> y;
if( op == '?' ) break;
 
if ( op == '+' ) cout << x + y << endl;
else if ( op == '-' ) cout << x - y << endl;
else if ( op == '*' ) cout << x * y << endl;
else if ( op == '/' ) cout << x / y << endl:
}

return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: error: expected ';' before ':' token
   15 | else if ( op == '/' ) cout << x / y << endl:
      |                                            ^
      |                                            ;
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: expected ';' before 'if'
    8 |                 cin >> a >> op >> b
      |                                    ^
      |                                    ;
    9 |                 if (op=='?') break;
      |                 ~~