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

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





Compiler output:
main.c:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> #include <string.h> int main(void) {
      |                    ^
main.c:3:9: error: expected identifier or '(' before 'for'
    3 | char s; for (i = 0; i < 1000; i++){ scanf("%d %c %d", &a, &s, &b);
      |         ^~~
main.c:3:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 | char s; for (i = 0; i < 1000; i++){ scanf("%d %c %d", &a, &s, &b);
      |                       ^
main.c:3:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 | char s; for (i = 0; i < 1000; i++){ scanf("%d %c %d", &a, &s, &b);
      |                                ^~
main.c:8:25: error: expected identifier or '(' before 'return'
    8 |  if (s == '?') break; } return 0; }
      |                         ^~~~~~
main.c:8:35: error: expected identifier or '(' before '}' token
    8 |  if (s == '?') break; } return 0; }
      |                                   ^
Language: C

#include <stdio.h>

int main()
{
    int a,b,c;
    char op;
    scanf("%d %c %d", &a, &op, &b);

    while(1) {
      scanf("%d%c%d", &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=='?'){
        break;
      }

      printf("%d\n", c);
    }

    return 0;


Compiler output:
main.c: In function 'main':
main.c:27:5: error: expected declaration or statement at end of input
   27 |     return 0;
      |     ^~~~~~
Language: C

#include <stdio.h>
int main(void){
  int a[],b[];
  int i;
  char op[];

  while(1){
    scanf("%d %c %d\n",a[i],op[i],b[i]);
    if(op[i] == "?"){
      break;
    }
    i++;
  }

  for(int j;j<i;j++){
    if(op[i]=="+"){
      printf("%d\n",a[i]+b[i]);
    }else if(op[i]=="-"){
      printf("%d\n",a[i]-b[i]);
    }else if(op[i]=="*"){
      printf("%d\n",a[i]*b[i]);
    }else if(op[i]=="/"){
      printf("%d\n",a[i]/b[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:3:7: error: array size missing in 'a'
    3 |   int a[],b[];
      |       ^
main.c:3:11: error: array size missing in 'b'
    3 |   int a[],b[];
      |           ^
main.c:5:8: error: array size missing in 'op'
    5 |   char op[];
      |        ^~
main.c:9:14: warning: comparison between pointer and integer
    9 |     if(op[i] == "?"){
      |              ^~
main.c:16:13: warning: comparison between pointer and integer
   16 |     if(op[i]=="+"){
      |             ^~
main.c:18:19: warning: comparison between pointer and integer
   18 |     }else if(op[i]=="-"){
      |                   ^~
main.c:20:19: warning: comparison between pointer and integer
   20 |     }else if(op[i]=="*"){
      |                   ^~
main.c:22:19: warning: comparison between pointer and integer
   22 |     }else if(op[i]=="/"){
      |                   ^~
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
  int i;
  int a[i],b[i];
  char op[i];

  while(1){
    scanf("%d %c %d\n",&a[i],&op[i],&b[i]);
        if(op[i]=='+'){
          break;
        }
    i++;
  }

  for(int j;j<i;j++){
    if(op[i]=='+'){
      printf("%d\n",a[i]+b[i]);
    }else if(op[i]=='-'){
      printf("%d\n",a[i]-b[i]);
    }else if(op[i]=='*'){
      printf("%d\n",a[i]*b[i]);
    }else if(op[i]=='/'){
      printf("%d\n",a[i]/b[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
    
    int a, b, x;
    char buf[256], *p;
    char op;
 
    for (;;) {
        gets(buf);
 
        p = buf;
        a = atoi(p);
        while (isspace(*p)) p++;
        while (isdigit(*p)) p++;
        while (isspace(*p)) p++;
        op = *p++;
        b = atoi(p);
 
        if      (op == '+') x = a + b;
        else if (op == '-') x = a - b;
        else if (op == '*') x = a * b;
        else if (op == '/') x = a / b;
        else break;
        printf("%d\n", x);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    9 |         gets(buf);
      |         ^~~~
      |         fgets
main.c:12:13: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   12 |         a = atoi(p);
      |             ^~~~
main.c:13:16: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   13 |         while (isspace(*p)) p++;
      |                ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
    1 | #include <stdio.h>
  +++ |+#include <ctype.h>
    2 | int main(void){
main.c:14:16: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   14 |         while (isdigit(*p)) p++;
      |                ^~~~~~~
main.c:14:16: note: include '<ctype.h>' or provide a declaration of 'isdigit'
Language: C

#include<stdio.h>

int main(void){
	int a,b;
	int ans;
	char op;
	for
	scanf("%d %c %d", &a, &op, &b);
	
	if ( op == '+' ){
		ans = a + b;
	} else if ( op == '-' ){
		ans = a - b;
	} else if ( op == '*' ){
		ans = a * b;
	} else if ( op == '/' ){
		ans = a / b;
	} else {
		return 0;
	}
	
	printf("%d\n",ans);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected '(' before 'scanf'
    8 |         scanf("%d %c %d", &a, &op, &b);
      |         ^~~~~
      |         (
Language: C

#include <stdio.h>
int main(void){
    
    int a, b, x;
    char buf[256], *p;
    char op;
 
    for (;;) {
        gets(buf);
 
        p = buf;
        a = atoi(p);
        while (isspace(*p)) p++;
        while (isdigit(*p)) p++;
        while (isspace(*p)) p++;
        op = *p++;
        b = atoi(p);
 
        if      (op == '+') x = a + b;
        else if (op == '-') x = a - b;
        else if (op == '*') x = a * b;
        else if (op == '/') x = a / b;
        else break;
        printf("%d\n", x);
        
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    9 |         gets(buf);
      |         ^~~~
      |         fgets
main.c:12:13: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   12 |         a = atoi(p);
      |             ^~~~
main.c:13:16: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   13 |         while (isspace(*p)) p++;
      |                ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
    1 | #include <stdio.h>
  +++ |+#include <ctype.h>
    2 | int main(void){
main.c:14:16: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
   14 |         while (isdigit(*p)) p++;
      |                ^~~~~~~
main.c:14:16: note: include '<ctype.h>' or provide a declaration of 'isdigit'
Language: C

#include<stdio.h>

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

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:17: error: break statement not within loop or switch
   19 |                 break;
      |                 ^~~~~
Language: C

#include <stdio.h>
int main(void){
    int a,b;
    char op;
    
    for(i = 1; i++){
    scanf("%d %d %c", &a, &b, &op);
    
    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);
    }
    }
    return 0;
    }



Compiler output:
main.c: In function 'main':
main.c:6:9: error: 'i' undeclared (first use in this function)
    6 |     for(i = 1; i++){
      |         ^
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:19: error: expected ';' before ')' token
    6 |     for(i = 1; i++){
      |                   ^
      |                   ;
Language: C

#include <stdio.h>
int main(void)
{
　int a, b, i;
  char op;
  for(i=0; i<1000; i++){
  scanf("%d %c %d", &a, &op, &b);
 
        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);
        }
        else 
            printf("\n");
  } 
  return 0;
}





Compiler output:
main.c: In function 'main':
main.c:4:1: error: stray '\343' in program
    4 | <U+3000>int a, b, i;
      | ^~~~~~~~
Language: C

#include <stdio.h>
int main(void)
{
　int a, b, i;
  char op;
  for(i=0; i<1000; i++){
  scanf("%d %c %d", &a, &op, &b);
 
        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);
        }
        if(op == '?') { 
            printf("\n");
        }

  } 
  return 0;
}





Compiler output:
main.c: In function 'main':
main.c:4:1: error: stray '\343' in program
    4 | <U+3000>int a, b, i;
      | ^~~~~~~~
Language: C

#include <stdio.h>
int main(void)
{
　int a, b, i;
  char op;
  for(i=0; i<1000; i++){
  scanf("%d %c %d", &a, &op, &b);
        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);
        }
        if(op == '?'){ 
            printf("\n");
        }
  } 
  return 0;
}




Compiler output:
main.c: In function 'main':
main.c:4:1: error: stray '\343' in program
    4 | <U+3000>int a, b, i;
      | ^~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
int a;
int b;
int ans;
char text[50];
scanf("%d%s%d",&a,text,&b);
if(text == +){
ans=a+b;}
if(text == -){
ans=a-b;}
if(text == *){
ans=a*b;}
if(text == /){
ans=a/b;}
printf("%d",ans);
}


Compiler output:
main.c: In function 'main':
main.c:10:13: error: expected expression before ')' token
   10 | if(text == +){
      |             ^
main.c:12:13: error: expected expression before ')' token
   12 | if(text == -){
      |             ^
main.c:14:13: error: expected expression before ')' token
   14 | if(text == *){
      |             ^
main.c:16:12: error: expected expression before '/' token
   16 | if(text == /){
      |            ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
int a;
int b;
int ans;
char text[50];
scanf("%d%s%d",&a,text,&b);
if(text == + ){
ans=a+b;}
if(text == - ){
ans=a-b;}
if(text == * ){
ans=a*b;}
if(text == / ){
ans=a/b;}
printf("%d",ans);
}


Compiler output:
main.c: In function 'main':
main.c:10:14: error: expected expression before ')' token
   10 | if(text == + ){
      |              ^
main.c:12:14: error: expected expression before ')' token
   12 | if(text == - ){
      |              ^
main.c:14:14: error: expected expression before ')' token
   14 | if(text == * ){
      |              ^
main.c:16:12: error: expected expression before '/' token
   16 | if(text == / ){
      |            ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
int a;
int b;
int ans;
char text[50];
scanf("%d%s%d",&a,text,&b);
if(text[3] == '+'){
ans=a+b;
printf("%d",ans);}
else if(text[3] == '-'){
ans=a-b;
printf("%d",ans);}
else if(text[3] == '*'){
ans=a*b;
printf("%d",ans);}
else if(text[3] == '/'){
ans=a/b;
printf("%d",ans);}
else break
}


Compiler output:
main.c: In function 'main':
main.c:22:6: error: break statement not within loop or switch
   22 | else break
      |      ^~~~~
main.c:22:11: error: expected ';' before '}' token
   22 | else break
      |           ^
      |           ;
   23 | }
      | ~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

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

for(i=1;i>0;i++){
  scanf("%d %s %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{
break}
}}


Compiler output:
main.c: In function 'main':
main.c:22:6: error: expected ';' before '}' token
   22 | break}
      |      ^
      |      ;
Language: C

#include <stdio.h>

int main() {
    int a, b;
    char op;
    
    while (op == '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        swhich (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            printf("%d\n", a / b);
            break;
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'swhich' [-Wimplicit-function-declaration]
   11 |         swhich (op) {
      |         ^~~~~~
main.c:11:20: error: expected ';' before '{' token
   11 |         swhich (op) {
      |                    ^~
      |                    ;
Language: C

#include <stdio.h>

int main() {
    int a, b;
    char op;
    
    while (op != '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        swhich (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            printf("%d\n", a / b);
            break;
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'swhich' [-Wimplicit-function-declaration]
   11 |         swhich (op) {
      |         ^~~~~~
main.c:11:20: error: expected ';' before '{' token
   11 |         swhich (op) {
      |                    ^~
      |                    ;
Language: C

#include <stdio.h>

int main() {
    int a, b;
    char op;
    
    while (op != '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        swhich (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            if (b != 0) {
                printf("%d\n", a / b);
            }
            break;
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'swhich' [-Wimplicit-function-declaration]
   11 |         swhich (op) {
      |         ^~~~~~
main.c:11:20: error: expected ';' before '{' token
   11 |         swhich (op) {
      |                    ^~
      |                    ;
Language: C

#include <stdio.h>

int main() {
    int a, b;
    char op;
    
    while (op != '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        swhich (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            printf("%d\n", a / b);
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'swhich' [-Wimplicit-function-declaration]
   11 |         swhich (op) {
      |         ^~~~~~
main.c:11:20: error: expected ';' before '{' token
   11 |         swhich (op) {
      |                    ^~
      |                    ;
Language: C

#include <stdio.h>

int main() {
    int a, b;
    char op;
    
    while (op != '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        switch (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            printf("%d\n", a / b);
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:13:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |             ptintf("%d\n", a + b);
      |             ^~~~~~
      |             printf
Language: C

#include <stdio.h>

int main() {
    int a, b;
    int op;
    
    while (op != '?') {
        
        scanf("%d %c %d", &a, &op, &b);
        
        switch (op) {
        case '+':
            ptintf("%d\n", a + b);
            break;
        case '-':
            printf("%d\n", a - b);
            break;
        case '*':
            printf("%d\n", a * b);
            break;
        case '/':
            printf("%d\n", a / b);
        default:
            break;
        } 
    }
    
    return 0;
   
}


Compiler output:
main.c: In function 'main':
main.c:13:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |             ptintf("%d\n", a + b);
      |             ^~~~~~
      |             printf
Language: C

#include <stdio.h>
int main(void)
{
	int a, b;
	char x[2];

	scanf("%d %c %d", a, x, d);

	if (x[0] == '+') {
		printf("%d\n", a + b);
	}

	else if (x[0] == '-') {
		printf("%d\n", a - b);
	}

	else if (x[0] == '*') {
		printf("%d\n", a*b);
	}

	else if (x[0] == '/') {
		printf("%d\n", a / b);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:33: error: 'd' undeclared (first use in this function)
    7 |         scanf("%d %c %d", a, x, d);
      |                                 ^
main.c:7:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void)
{
	int a, b;
	char x[2];

	scanf("%d %c %d", a, x[0], d);

	if (x[0] == '+') {
		printf("%d\n", a + b);
	}

	else if (x[0] == '-') {
		printf("%d\n", a - b);
	}

	else if (x[0] == '*') {
		printf("%d\n", a*b);
	}

	else if (x[0] == '/') {
		printf("%d\n", a / b);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:36: error: 'd' undeclared (first use in this function)
    7 |         scanf("%d %c %d", a, x[0], d);
      |                                    ^
main.c:7:36: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

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

	scanf("%d %c %d" ,&a ,&op ,&b);

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

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:24: error: expected expression before '==' token
   12 |         if (op == '-') == 0) {
      |                        ^~
main.c:12:28: error: expected statement before ')' token
   12 |         if (op == '-') == 0) {
      |                            ^
main.c:15:24: error: expected expression before '==' token
   15 |         if (op == '*') == 0) {
      |                        ^~
main.c:15:28: error: expected statement before ')' token
   15 |         if (op == '*') == 0) {
      |                            ^
main.c:18:24: error: expected expression before '==' token
   18 |         if (op == '/') == 0) {
      |                        ^~
main.c:18:28: error: expected statement before ')' token
   18 |         if (op == '/') == 0) {
      |                            ^
Language: C

#include <iostream>
#include<string>

using namespace std;

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

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main(int argc, char* argv[])
{
  int a, b;
  char op:
  scanf("%d %c %d", &a, &op, &b);
  while(op != '?'){
    switch(op){
      case:'+'
        printf("%d\n", a+b);
        break;
      case:'-'
        printf("%d\n", a-b);
        break;
     case:'/'
        printf("%d\n", a/b);
        break;
     case:'*'
        printf("%d\n", a*b);
        break;
    }
    scanf("%d %c %d", &a, &op, &b);  
  }
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:6:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    6 |   char op:
      |          ^
main.c:6:10: error: expected expression before ':' token
main.c:8:9: error: 'op' undeclared (first use in this function)
    8 |   while(op != '?'){
      |         ^~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:11: error: expected expression before ':' token
   10 |       case:'+'
      |           ^
main.c:10:15: error: expected ';' before 'printf'
   10 |       case:'+'
      |               ^
      |               ;
   11 |         printf("%d\n", a+b);
      |         ~~~~~~ 
main.c:13:11: error: expected expression before ':' token
   13 |       case:'-'
      |           ^
main.c:13:15: error: expected ';' before 'printf'
   13 |       case:'-'
      |               ^
      |               ;
   14 |         printf("%d\n", a-b);
      |         ~~~~~~ 
main.c:16:10: error: expected expression before ':' token
   16 |      case:'/'
      |          ^
main.c:16:14: error: expected ';' before 'printf'
   16 |      case:'/'
      |              ^
      |              ;
   17 |         printf("%d\n", a/b);
      |         ~~~~~~
main.c:19:10: error: expected expression before ':' token
   19 |      case:'*'
      |          ^
main.c:19:14: error: expected ';' before 'printf'
   19 |      case:'*'
      |              ^
      |              ;
   20 |         printf("%d\n", a*b);
      |         ~~~~~~
Language: C

#include<stdio.h>

int main(int argc, char* argv[])
{
  int a, b;
  char op;
  scanf("%d %c %d", &a, &op, &b);
  while(op != '?'){
    switch(op){
      case:'+'
        printf("%d\n", a+b);
        break;
      case:'-'
        printf("%d\n", a-b);
        break;
     case:'/'
        printf("%d\n", a/b);
        break;
     case:'*'
        printf("%d\n", a*b);
        break;
    }
    scanf("%d %c %d", &a, &op, &b);  
  }
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: expected expression before ':' token
   10 |       case:'+'
      |           ^
main.c:10:15: error: expected ';' before 'printf'
   10 |       case:'+'
      |               ^
      |               ;
   11 |         printf("%d\n", a+b);
      |         ~~~~~~ 
main.c:13:11: error: expected expression before ':' token
   13 |       case:'-'
      |           ^
main.c:13:15: error: expected ';' before 'printf'
   13 |       case:'-'
      |               ^
      |               ;
   14 |         printf("%d\n", a-b);
      |         ~~~~~~ 
main.c:16:10: error: expected expression before ':' token
   16 |      case:'/'
      |          ^
main.c:16:14: error: expected ';' before 'printf'
   16 |      case:'/'
      |              ^
      |              ;
   17 |         printf("%d\n", a/b);
      |         ~~~~~~
main.c:19:10: error: expected expression before ':' token
   19 |      case:'*'
      |          ^
main.c:19:14: error: expected ';' before 'printf'
   19 |      case:'*'
      |              ^
      |              ;
   20 |         printf("%d\n", a*b);
      |         ~~~~~~
Language: C

#include<stdio.h> int main(){       int a,b,i;     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:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include<stdio.h> int main(){       int a,b,i;     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;   }
      |                   ^~~
/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<stdio.h>
#define PI 3.141592653589

int main()
{
  int a,b,ans;
  char op;
  scanf("%d %c %d",a,op,b);
  while(1)
    {
      if(op == '+')
	{
	  ans = a + b;
	}
      else if(op == '-')
	{
	  ans = a - b;
	}
      else if(op == '*')
	{
	  ans = a * b;
	}
      else if(op == '/')
	{
	  ans = a / b;
	}
      else
	{
	  exit(); 
	}
      printf("%d\n",ans);
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:11: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   29 |           exit();
      |           ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | #define PI 3.141592653589
main.c:29:11: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   29 |           exit();
      |           ^~~~
main.c:29:11: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:29:11: error: too few arguments to function 'exit'
Language: C

#include<stdio.h>
#include<stdlib.h>
#define PI 3.141592653589

int main()
{
  int a,b,ans;
  char op;
  scanf("%d %c %d",a,op,b);
  while(1)
    {
      if(op == '+')
	{
	  ans = a + b;
	}
      else if(op == '-')
	{
	  ans = a - b;
	}
      else if(op == '*')
	{
	  ans = a * b;
	}
      else if(op == '/')
	{
	  ans = a / b;
	}
      else
	{
	  exit(); 
	}
      printf("%d\n",ans);
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:11: error: too few arguments to function 'exit'
   30 |           exit();
      |           ^~~~
In file included from main.c:2:
/usr/include/stdlib.h:756:13: note: declared here
  756 | extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
      |             ^~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:5: error: break statement not within loop or switch
    9 |     break;
      |     ^~~~~
Language: C

#!/usr/bin/python

import sys

equation = raw_input().split(" ")

a = int(equation[0])
b = int(equation[2])
mark = equation[1]

if mark == "?":
  sys.exit()
elif mark == "+":
  print str(a+b) + "\n"
elif mark == "-":
  print str(a-b) + "\n"
elif mark == "*":
  print str(a*b) + "\n"
elif mark == "/":
  print str(a/b) + "\n"

sys.exit()

Compiler output:
main.c:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/python
      |  ^
main.c:3:1: error: unknown type name 'import'
    3 | import sys
      | ^~~~~~
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'equation'
    5 | equation = raw_input().split(" ")
      | ^~~~~~~~
Language: C

#include<iostream>
int main(){
int a,b;
char op;

while(std::cin>>a>>op>>b,op-63){
if(op==43)std::cout<<a+b;
else if(op==45)std::cout<<a-b;
else if(op==42)std::cout<<a*b;
else if(op==47)std::cout<<a/b;
std::cout<<std::endl;
}
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

while line = gets do
  next if line =~ /\?/ 
  puts(eval line)
end 

Compiler output:
main.c:1:1: error: expected identifier or '(' before 'while'
    1 | while line = gets do
      | ^~~~~
main.c:2:20: error: stray '\' in program
    2 |   next if line =~ /\?/
      |                    ^
Language: C

#include<stdio.h>

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

scnaf("%d %c %d",&a,&op,&b) ;

if( op != ( + || - || * || / ){
printf("error\n") ;
}

else{
    switch(op){
    Case + :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    Case - :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    Case * :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    Case / :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}
	else{
	printf("error\n") ;
	}

    Case ? :
	break ;
}
}

    

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 | scnaf("%d %c %d",&a,&op,&b) ;
      | ^~~~~
      | scanf
main.c:10:15: error: expected expression before '||' token
   10 | if( op != ( + || - || * || / ){
      |               ^~
main.c:10:31: error: expected ')' before '{' token
   10 | if( op != ( + || - || * || / ){
      |   ~                           ^
      |                               )
main.c:46:1: error: expected declaration or statement at end of input
   46 | }
      | ^
Language: C

#include<stdio.h>

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

scnaf("%d %c %d",&a,&op,&b) ;

if( op != ( + || - || * || / ){
printf("error\n") ;
}

else{
    switch(op){
    Case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    Case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    Case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    Case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}
	else{
	printf("error\n") ;
	}

    Case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 | scnaf("%d %c %d",&a,&op,&b) ;
      | ^~~~~
      | scanf
main.c:10:15: error: expected expression before '||' token
   10 | if( op != ( + || - || * || / ){
      |               ^~
main.c:10:31: error: expected ')' before '{' token
   10 | if( op != ( + || - || * || / ){
      |   ~                           ^
      |                               )
main.c:49:1: error: expected declaration or statement at end of input
   49 | }
      | ^
Language: C

#include<stdio.h>

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

scnaf("%d %c %d",&a,&op,&b) ;

if( op != ( '+' || '-'|| '*' || '/' ){
printf("error\n") ;
}

else{
    switch(op){
    Case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    Case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    Case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    Case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}

	else{
	printf("error\n") ;
	}

    Case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 | scnaf("%d %c %d",&a,&op,&b) ;
      | ^~~~~
      | scanf
main.c:10:38: error: expected ')' before '{' token
   10 | if( op != ( '+' || '-'|| '*' || '/' ){
      |   ~                                  ^
      |                                      )
main.c:50:1: error: expected declaration or statement at end of input
   50 | }
      | ^
Language: C

#include<stdio.h>

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

scnaf("%d %c %d",&a,&op,&b) ;

if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
printf("error\n") ;
}

else{
/* 文字列としての値比較するのであれば''で囲みます。*/
    switch(op){
    Case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    Case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    Case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    Case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}

	else{
	printf("error\n") ;
	}

    Case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 | scnaf("%d %c %d",&a,&op,&b) ;
      | ^~~~~
      | scanf
main.c:10:44: error: expected ')' before '{' token
   10 | if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
      |   ~                                        ^
      |                                            )
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include<stdio.h>

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

scanf("%d %c %d",&a,&op,&b) ;

if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
printf("error\n") ;
}

else{
/* 文字列としての値比較するのであれば''で囲みます。*/
    switch(op){
    Case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    Case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    Case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    Case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}

	else{
	printf("error\n") ;
	}

    Case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:10:44: error: expected ')' before '{' token
   10 | if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
      |   ~                                        ^
      |                                            )
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include<stdio.h>

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

scanf("%d %c %d",&a,&op,&b) ;

if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
printf("error\n") ;
}

else{
/* 文字列としての値比較するのであれば''で囲みます。*/
    switch(op){
    case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}

	else{
	printf("error\n") ;
	}

    case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:10:44: error: expected ')' before '{' token
   10 | if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
      |   ~                                        ^
      |                                            )
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include<stdio.h>

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

scanf("%d %c %d",&a,&op,&b) ;

/*if( op != ( '+' || '-'|| '*' || '/'|| '?' ){
printf("error\n") ;
}

else{  */

    switch(op){
    case '+' :
 	rst = a+b ;
	print("%d",rst) ;
	break ;


    case '-' :
 	rst = a-b ;
	print("%d",rst) ;
	break ;
	

    case '*' :
 	rst = a*b ;
	print("%d",rst) ;
	break ;


    case '/' :
	if(b != 0){
 	rst = a/b ;
	print("%d",rst) ;
	break ;}

	else{
	printf("error\n") ;
	}

    case '?' :
	break ;
}

return 0 ;

}

    

Compiler output:
main.c: In function 'main':
main.c:19:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   19 |         print("%d",rst) ;
      |         ^~~~~
      |         printf
Language: C

#include<stdio.h>

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

scanf("%d %c %d",&a,&op,&b) ;

if(op != '+' || '-' || '*' || '/'){
     printf("error!\n) ;
     }
    else{
    switch(op){
    case '+' :
     rst = a+b ;
     printf("%d\n",rst) ;
     break ;


    case '-' :
     rst = a-b ;
     printf("%d\n",rst) ;
     break ;
   

    case '*' :
     rst = a*b ;
     printf("%d\n",rst) ;
     break ;


    case '/' :
     if(b != 0){
     rst = a/b ;
     printf("%d\n",rst) ;
     break ;}
     else{
     printf("error\n") ;
     }


    case '?' :
     break ;
}

return 0 ;

}
 

/* エラーが出ていた原因 :
printfとすべきところをprintにしていた。
if文の条件式の()が閉じられていなかった。
{が閉じる場所を間違えた。
printfで出力するときに、%dのあとに改行コード\nの入れ忘れ。
*/ 

Compiler output:
main.c: In function 'main':
main.c:11:13: warning: missing terminating " character
   11 |      printf("error!\n) ;
      |             ^
main.c:11:13: error: missing terminating " character
   11 |      printf("error!\n) ;
      |             ^~~~~~~~~~~~
main.c:12:6: error: expected expression before '}' token
   12 |      }
      |      ^
main.c:11:13: error: expected ';' before '}' token
   11 |      printf("error!\n) ;
      |             ^
      |             ;
   12 |      }
      |      ~       
main.c:49:1: error: expected declaration or statement at end of input
   49 | }
      | ^
Language: C

#include<stdio.h>

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

scanf("%d %c %d",&a,&op,&b) ;

if(op != ('+' || '-' || '*' || '/' )){
     printf("error!\n) ;
     }
    else{
    switch(op){
    case '+' :
     rst = a+b ;
     printf("%d\n",rst) ;
     break ;


    case '-' :
     rst = a-b ;
     printf("%d\n",rst) ;
     break ;
   

    case '*' :
     rst = a*b ;
     printf("%d\n",rst) ;
     break ;


    case '/' :
     if(b != 0){
     rst = a/b ;
     printf("%d\n",rst) ;
     break ;
     }
     else{
     printf("error\n") ;
     }


    case '?' :
     break ;
}
}
return 0 ;

}
 

/* エラーが出ていた原因 :
printfとすべきところをprintにしていた。
if文の条件式の()が閉じられていなかった。
{が閉じる場所を間違えた。
printfで出力するときに、%dのあとに改行コード\nの入れ忘れ。
*/ 

Compiler output:
main.c: In function 'main':
main.c:11:13: warning: missing terminating " character
   11 |      printf("error!\n) ;
      |             ^
main.c:11:13: error: missing terminating " character
   11 |      printf("error!\n) ;
      |             ^~~~~~~~~~~~
main.c:12:6: error: expected expression before '}' token
   12 |      }
      |      ^
main.c:11:13: error: expected ';' before '}' token
   11 |      printf("error!\n) ;
      |             ^
      |             ;
   12 |      }
      |      ~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:30: error: 'mozi' undeclared (first use in this function)
    7 |         scanf("%d%c%d", &a, &mozi, &b);
      |                              ^~~~
main.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:17: error: 'bleak' undeclared (first use in this function)
   21 |                 bleak;
      |                 ^~~~~
main.c:23:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   23 |         print("%d\n", c);
      |         ^~~~~
      |         printf
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		String op = scan.next();
		int b = Integer.parseInt(scan.next());
		while(!op.equals("?")){
			if(op.equals("+")){
				System.out.println(a+b);
			}
			else if(op.equals("-")){
				System.out.println(a-b);
			}
			else if(op.equals("*")){
				System.out.println(a*b);
			}
			else if(op.equals("/")){
				System.out.println(a/b);
			}
			a = Integer.parseInt(scan.next());
			op = scan.next();
			b = Integer.parseInt(scan.next());
		}
		scan.close();
	}

}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'public'
    2 | public class Main {
      | ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    2 | public class Main {
      |              ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a,op,b;
	cin>>a>>op>>b;
	while(op==?){
	    if(op=='+')cout<<a+b<<endl;
	    if(op=='-')cout<<a-b<<endl;
	    if(op=='*')cout<<a*b<<endl;
	    if(op=='/')printf("%f\n",1.0*a/b);
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before '?' token
    6 |         while(op==?){
      |                   ^
a.cc:6:20: error: expected primary-expression before ')' token
    6 |         while(op==?){
      |                    ^
a.cc:6:20: error: expected ':' before ')' token
    6 |         while(op==?){
      |                    ^
      |                    :
a.cc:6:20: error: expected primary-expression before ')' token
Language: C++

#include <iostream>

int main(){
    int a,b,ans;
    char op;
    while(true){
        cin >> a >> op >> b;
        if(op == '?')break;
        else if(op == '+'){
            ans = a+b;
        }
        else if(op == '-'){
            ans = a-b;
        }
        else if(op == '*'){
            ans = a*b;
        }
        else if(op == '/'){
            ans = a/b;
        }
        cout << ans << 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:21:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |         cout << ans << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |         cout << ans << 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 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 == '?'){
	break;
	}
	return 0;
}



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

#include <iostream>
#include <iomanip>

using namespace std;
int main() {
	int a, b;
	char op;
	cin>> a >> b >> op;
	while(op != '?'){	
		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;
		}
	}cin>> a >> b >> op;
	while(op != '?'){	
		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:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b, x;
    string op;
    while(1){
        cin >> a >> op >> b;
        switch(op){
            case +:
                x = a + b;
            case -:
                x = a - b;
            case *:
                x = a * b;
            case /:
                x = a / b;
            case ?:
                return 0;
        }
        cout << x << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: switch quantity not an integer
    8 |         switch(op){
      |                ^~
a.cc:9:19: error: expected primary-expression before ':' token
    9 |             case +:
      |                   ^
a.cc:11:19: error: expected primary-expression before ':' token
   11 |             case -:
      |                   ^
a.cc:13:19: error: expected primary-expression before ':' token
   13 |             case *:
      |                   ^
a.cc:15:18: error: expected primary-expression before '/' token
   15 |             case /:
      |                  ^
a.cc:15:19: error: expected primary-expression before ':' token
   15 |             case /:
      |                   ^
a.cc:17:18: error: expected primary-expression before '?' token
   17 |             case ?:
      |                  ^
a.cc:18:17: error: expected primary-expression before 'return'
   18 |                 return 0;
      |                 ^~~~~~
a.cc:17:20: error: expected ':' before 'return'
   17 |             case ?:
      |                    ^
      |                    :
   18 |                 return 0;
      |                 ~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b, x;
    string op;
    while(1){
        cin >> a >> op >> b;
        switch(op){
            case '+':
                x = a + b;
            case '-':
                x = a - b;
            case '*':
                x = a * b;
            case '/':
                x = a / b;
            case '?':
                return 0;
        }
        cout << x << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: switch quantity not an integer
    8 |         switch(op){
      |                ^~