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



#include <iostream> 
#include <stdio.h> #include <stdlib.h> #include <string.h> #define TABLE_SIZE 16777216 #define ORDER_LENGTH 7 #define STR_LENGTH 13 using namespace std; int array[128]; int translateStr(char buf[]){ int sum = -1,mult = 1; for(int i = 0; buf[i] != '\0'; i++){ sum += array[buf[i]]*mult; mult *= 4; } return sum; } int main(){ array['A']=1,array['C']=2,array['G']=3,array['T']=4; int n; scanf("%d",&n); char order[ORDER_LENGTH],str[STR_LENGTH]; char* check_table = new char[TABLE_SIZE]; for(int i = 0; i < n; i++){ scanf("%s %s",order,str); if(order[0] == 'i'){ check_table[translateStr(str)] = 'Y'; }else{ if(check_table[translateStr(str)] == 'Y'){ printf("yes\n"); }else{ printf("no\n"); } } } } 




Compiler output:
a.cc:4:20: warning: extra tokens at end of #include directive
    4 | #include <stdio.h> #include <stdlib.h> #include <string.h> #define TABLE_SIZE 16777216 #define ORDER_LENGTH 7 #define STR_LENGTH 13 using namespace std; int array[128]; int translateStr(char buf[]){ int sum = -1,mult = 1; for(int i = 0; buf[i] != '\0'; i++){ sum += array[buf[i]]*mult; mult *= 4; } return sum; } int main(){ array['A']=1,array['C']=2,array['G']=3,array['T']=4; int n; scanf("%d",&n); char order[ORDER_LENGTH],str[STR_LENGTH]; char* check_table = new char[TABLE_SIZE]; for(int i = 0; i < n; i++){ scanf("%s %s",order,str); if(order[0] == 'i'){ check_table[translateStr(str)] = 'Y'; }else{ if(check_table[translateStr(str)] == 'Y'){ printf("yes\n"); }else{ printf("no\n"); } } } }
      |                    ^
/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>
#include <char>
using namespace std;

int main()
{
    char op; 
   int a,b;
   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{
                     }
                return 0;
                       
    }


Compiler output:
a.cc:2:10: fatal error: char: No such file or directory
    2 | #include <char>
      |          ^~~~~~
compilation terminated.
Language: C++

#include <cstdio>

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


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

#include <cstdio>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(a == 0 && op == "?" && b == 0) break;
      |                      ~~~^~~~~~
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '?' token
    8 | if(op==?)break;
      |        ^
a.cc:8:9: error: expected primary-expression before ')' token
    8 | if(op==?)break;
      |         ^
a.cc:8:9: error: expected ':' before ')' token
    8 | if(op==?)break;
      |         ^
      |         :
a.cc:8:9: error: expected primary-expression before ')' token
a.cc:9:14: error: expected primary-expression before ')' token
    9 | else if(op==+) cout << a+b <<endl;
      |              ^
a.cc:10:14: error: expected primary-expression before ')' token
   10 | else if(op==-) cout << a-b <<endl;
      |              ^
a.cc:11:14: error: expected primary-expression before ')' token
   11 | else if(op==*) cout << a*b <<endl;
      |              ^
a.cc:12:13: error: expected primary-expression before '/' token
   12 | else if(op==/) cout << a/b <<endl;
      |             ^
a.cc:12:14: error: expected primary-expression before ')' token
   12 | else if(op==/) cout << a/b <<endl;
      |              ^
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '?' token
    8 | if(op==?)break;
      |        ^
a.cc:8:9: error: expected primary-expression before ')' token
    8 | if(op==?)break;
      |         ^
a.cc:8:9: error: expected ':' before ')' token
    8 | if(op==?)break;
      |         ^
      |         :
a.cc:8:9: error: expected primary-expression before ')' token
a.cc:9:14: error: expected primary-expression before ')' token
    9 | else if(op==+) cout << a+b <<endl;
      |              ^
a.cc:10:14: error: expected primary-expression before ')' token
   10 | else if(op==-) cout << a-b <<endl;
      |              ^
a.cc:11:14: error: expected primary-expression before ')' token
   11 | else if(op==*) cout << a*b <<endl;
      |              ^
a.cc:12:13: error: expected primary-expression before '/' token
   12 | else if(op==/) cout << a/b <<endl;
      |             ^
a.cc:12:14: error: expected primary-expression before ')' token
   12 | else if(op==/) cout << a/b <<endl;
      |              ^
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before '?' token
    8 | if(op==?)break;
      |        ^
a.cc:8:9: error: expected primary-expression before ')' token
    8 | if(op==?)break;
      |         ^
a.cc:8:9: error: expected ':' before ')' token
    8 | if(op==?)break;
      |         ^
      |         :
a.cc:8:9: error: expected primary-expression before ')' token
a.cc:9:15: error: expected primary-expression before ')' token
    9 | else if (op==+) cout << a+b <<endl;
      |               ^
a.cc:10:15: error: expected primary-expression before ')' token
   10 | else if (op==-) cout << a-b <<endl;
      |               ^
a.cc:11:15: error: expected primary-expression before ')' token
   11 | else if (op==*) cout << a*b <<endl;
      |               ^
a.cc:12:14: error: expected primary-expression before '/' token
   12 | else if (op==/) cout << a/b <<endl;
      |              ^
a.cc:12:15: error: expected primary-expression before ')' token
   12 | else if (op==/) cout << a/b <<endl;
      |               ^
Language: C++

#include<iostream>
using namespace std;

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

	while(op == "?"){
		cin >> a >> op >> b;

		if(op == "+") answer = a + b;
		else if(op == "-") answer = a - b;
		else if(op == "*") answer = a * b;
		else if(op == "/") answer = a / b;
		else return = -1;

		cout << answer << endl;

		return 0;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         while(op == "?"){
      |               ~~~^~~~~~
a.cc:11:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 if(op == "+") answer = a + b;
      |                    ~~~^~~~~~
a.cc:12:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                 else if(op == "-") answer = a - b;
      |                         ~~~^~~~~~
a.cc:13:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                 else if(op == "*") answer = a * b;
      |                         ~~~^~~~~~
a.cc:14:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |                 else if(op == "/") answer = a / b;
      |                         ~~~^~~~~~
a.cc:15:29: error: expected primary-expression before '=' token
   15 |                 else return = -1;
      |                             ^
Language: C++

#include<iostream>
using namespace std;

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

	while(1){
		cin >> a >> op >> b;
		if(op == "?") break;

		if(op == "+") answer = a + b;
		else if(op == "-") answer = a - b;
		else if(op == "*") answer = a * b;
		else if(op == "/") answer = a / b;
		else return = -1;

		cout << answer << endl;

		return 0;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 if(op == "?") break;
      |                    ~~~^~~~~~
a.cc:12:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                 if(op == "+") answer = a + b;
      |                    ~~~^~~~~~
a.cc:13:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                 else if(op == "-") answer = a - b;
      |                         ~~~^~~~~~
a.cc:14:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |                 else if(op == "*") answer = a * b;
      |                         ~~~^~~~~~
a.cc:15:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 else if(op == "/") answer = a / b;
      |                         ~~~^~~~~~
a.cc:16:29: error: expected primary-expression before '=' token
   16 |                 else return = -1;
      |                             ^
Language: C++

#include<iostream>
using namespace std;

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

	while(1){
		cin >> a >> op >> b;
		if(op == "?") break;

		if(op == "+") answer = a + b;
		else if(op == "-") answer = a - b;
		else if(op == "*") answer = a * b;
		else if(op == "/") answer = a / b;
		
		cout << answer << endl;

		return 0;
	}
}


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

# -*- coding: utf-8


while True:
   A = raw_input().split()
   if A[1] == '?':
      break
   if A[1] == '+':
      print(int(A[0])+int(A[2]))
   if A[1] == '-':
      print(int(A[0])-int(A[2]))
   if A[1] == '*':
      print(int(A[0])*int(A[2]))
   if A[1] == '/':
      print(int(A[0])/int(A[2]))





Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- 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 op;
    while(cin >> a >> op >> b,op != '?'){
        cout << (op == '+'?a+b : op == '-'?a-b : op == '*'?a*b : op == '/'?a/b) << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:79: error: expected ':' before ')' token
    8 |         cout << (op == '+'?a+b : op == '-'?a-b : op == '*'?a*b : op == '/'?a/b) << endl;
      |                                                                               ^
      |                                                                               :
a.cc:8:79: error: expected primary-expression before ')' token
Language: C++

#include<iostream>
int main(){
	int op, i,a,b;
	for (i = 0; i < 20000; i++){
		cin >> a >> op >> b;
		if (op == ? ){ break; }
		else { cout << a op b << endl; }
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |                 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:6:27: error: expected primary-expression before '?' token
    6 |                 if (op == ? ){ break; }
      |                           ^
a.cc:6:29: error: expected primary-expression before ')' token
    6 |                 if (op == ? ){ break; }
      |                             ^
a.cc:6:28: error: expected ':' before ')' token
    6 |                 if (op == ? ){ break; }
      |                            ^~
      |                            :
a.cc:6:29: error: expected primary-expression before ')' token
    6 |                 if (op == ? ){ break; }
      |                             ^
a.cc:7:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |                 else { cout << a op b << 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 std;

int main()
{
 int a,b;
 char c;
 for(;;){
 cin >> a>>c>>b;
 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;
else
 break;
}
return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected primary-expression before ')' token
   11 |  if(c==+)
      |         ^
a.cc:13:14: error: expected primary-expression before ')' token
   13 | else if (c==-)
      |              ^
a.cc:15:14: error: expected primary-expression before ')' token
   15 | else if (c==*)
      |              ^
a.cc:17:13: error: expected primary-expression before '/' token
   17 | else if (c==/)
      |             ^
a.cc:17:14: error: expected primary-expression before ')' token
   17 | else if (c==/)
      |              ^
Language: C++

#include<iostream>

using namespace std;

int main()
{
 int a,b;
 char c;
 for(;;){
 cin >> a>>c>>b;
 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;
else
 break;
}
return 0;
}



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

#include <stdio.h>

int main(void){
  int a, b;
  char op;
  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if(op==?){
      break;
    }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=='/'){
      printf("%d\n", a/b);
    }
  }
  return 0;
}


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

#include <stdio.h>

int main(void){
  int a, b;
  char op;
  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if(op=='?'){
      break;
    }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=='/'){
      printf("%d\n", a/b);
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected ')' before '{' token
   12 |     }else if(op=='-'{
      |             ~       ^
      |                     )
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
Language: C++

#include<iostream>
using namespace std;

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


	while(1){
		cin>>a>>b>>op;

		if(op=='+'){
			i=a+b;
		    cout<<i<<endl;
		}
		else if(op=='-'){
			i=a-b;
			cout<<i<<endl;
		}
		else if(op=='*'){
			i=a*b;
			cout<<i<<endl;
		}
		else if(op=='/'){
			i=a/b;
			cout<<i<<endl;
		}
		eif(op=='?'){
			break;
		}

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'eif' was not declared in this scope
   28 |                 eif(op=='?'){
      |                 ^~~
Language: C++

iostream>
using namespace std;

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


	while(1){
		cin>>a>>b>>op;

		if(op=='+'){
			i=a+b;
		    cout<<i<<endl;
		}
		else if(op=='-'){
			i=a-b;
			cout<<i<<endl;
		}
		else if(op=='*'){
			i=a*b;
			cout<<i<<endl;
		}
		else if(op=='/'){
			i=a/b;
			cout<<i<<endl;
		}
		if(op=='?'){
			break;
		}

	}

	return 0;
}


Compiler output:
a.cc:1:1: error: 'iostream' does not name a type
    1 | iostream>
      | ^~~~~~~~
a.cc: In function 'int main()':
a.cc:10:17: error: 'cin' was not declared in this scope
   10 |                 cin>>a>>b>>op;
      |                 ^~~
a.cc:14:21: error: 'cout' was not declared in this scope
   14 |                     cout<<i<<endl;
      |                     ^~~~
a.cc:14:30: error: 'endl' was not declared in this scope
   14 |                     cout<<i<<endl;
      |                              ^~~~
a.cc:18:25: error: 'cout' was not declared in this scope
   18 |                         cout<<i<<endl;
      |                         ^~~~
a.cc:18:34: error: 'endl' was not declared in this scope
   18 |                         cout<<i<<endl;
      |                                  ^~~~
a.cc:22:25: error: 'cout' was not declared in this scope
   22 |                         cout<<i<<endl;
      |                         ^~~~
a.cc:22:34: error: 'endl' was not declared in this scope
   22 |                         cout<<i<<endl;
      |                                  ^~~~
a.cc:26:25: error: 'cout' was not declared in this scope
   26 |                         cout<<i<<endl;
      |                         ^~~~
a.cc:26:34: error: 'endl' was not declared in this scope
   26 |                         cout<<i<<endl;
      |                                  ^~~~
Language: C++

#include <iostream>
using namespace std;

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


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

#include <iostream>
#include <string>
using namespace std;

int main(){
    int a, b, ans;
    string op;
    
    cin >> a >> op >> b;
    if(op[0] == "+"){
        ans = a + b;
        cout << ans << endl;
    }
    else if(op == "-"){
        ans = a - b;
        cout << ans << endl;
    }
    else if(op == "*"){
        ans = a * b;
        cout << ans << endl;
    }
    else if(op == "/"){
        ans = a / b;
        cout << ans << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(op[0] == "+"){
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>


using namespace std;
int main(){
    int a, b;
    char op;
    cin >> a >> op >> b ;
    while (1) {
        if (a == 0 && b == 0){
            break;
        }else{
            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:30:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |             if (op == "+"){
      |                 ~~~^~~~~~
a.cc:32:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |             } else if (op == "-"){
      |                        ~~~^~~~~~
a.cc:34:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |             } else if (op == "*"){
      |                        ~~~^~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>


using namespace std;
int main(){
    int a, b;
    str op;
    cin >> a >> op >> b ;
    while (1) {
        if (a == 0 && b == 0){
            break;
        }else{
            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:24:5: error: 'str' was not declared in this scope; did you mean 'std'?
   24 |     str op;
      |     ^~~
      |     std
a.cc:25:17: error: 'op' was not declared in this scope
   25 |     cin >> a >> op >> b ;
      |                 ^~
Language: C++

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


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

#include <iostream>
#include <string>
using namespace std;

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


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

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'swith' was not declared in this scope; did you mean 'wcwidth'?
   11 |         swith(c){
      |         ^~~~~
      |         wcwidth
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before 'swith'
   11 |         if(c== '?')break
      |                         ^
      |                         ;
   12 | 
   13 |         swith(c){
      |         ~~~~~            
a.cc:13:9: error: 'swith' was not declared in this scope; did you mean 'wcwidth'?
   13 |         swith(c){
      |         ^~~~~
      |         wcwidth
Language: C++

#include <iostream>
#define EVER (;;)
using namespace std;

int main() {
    int a, b;
    char op;
    bool flag = false;
    for EVER {
        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;
            default:
                flag = true;
                break;
        }
    if (flag) break;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: expected primary-expression before ',' token
   16 |                 cout << a-b <, endl;
      |                              ^
Language: C++

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


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

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


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

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


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

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


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

#include<iostream>
using namespace std;
int main(){
int a,b;
char op;
for(i=0;  ; i++){
cin >> a >> op >> b;
if(op=='?')break;

if(op=='+') cout << a+b <<endl;
else if(op=='-') cout << a-b <<endl;
else if(op=='*') cout << a*b <<endl;
else if(op=='/') cout << a/b <<endl;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(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;}
if( op =='+'){
cout<< a + b;
}else if( op =='-'){
cout<< a - b;
}else if
( op =='*'){ 
cout<< a * b;
}else if( op =='/'){
cout<< a / b;
}else{
cout<<endl;
}
return 0;
}




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

#include <iostream>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
 //Compiler version g++ 6.3.0

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if(b=="?")break;
      |                    ~^~~~~
a.cc:18:22: error: conversion from 'const char*' to 'int' in a converted constant expression
   18 |                 case "+":
      |                      ^~~
a.cc:18:22: error: could not convert '"+"' from 'const char [2]' to 'int'
   18 |                 case "+":
      |                      ^~~
      |                      |
      |                      const char [2]
a.cc:21:22: error: conversion from 'const char*' to 'int' in a converted constant expression
   21 |                 case "-":
      |                      ^~~
a.cc:21:22: error: could not convert '"-"' from 'const char [2]' to 'int'
   21 |                 case "-":
      |                      ^~~
      |                      |
      |                      const char [2]
a.cc:24:22: error: conversion from 'const char*' to 'int' in a converted constant expression
   24 |                 case "*":
      |                      ^~~
a.cc:24:22: error: could not convert '"*"' from 'const char [2]' to 'int'
   24 |                 case "*":
      |                      ^~~
      |                      |
      |                      const char [2]
a.cc:27:22: error: conversion from 'const char*' to 'int' in a converted constant expression
   27 |                 case "/":
      |                      ^~~
a.cc:27:22: error: could not convert '"/"' from 'const char [2]' to 'int'
   27 |                 case "/":
      |                      ^~~
      |                      |
      |                      const char [2]
Language: C++

#include<iostream>
using namespace std;

int main(){
	int a,b,op;
	cin>>a>>op>>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;
	}

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    8 |         if(op="+"){
      |               ^~~
      |               |
      |               const char*
a.cc:11:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   11 |         if(op="-"){
      |               ^~~
      |               |
      |               const char*
a.cc:14:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   14 |         if(op="*"){
      |               ^~~
      |               |
      |               const char*
a.cc:17:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   17 |         if(op="/"){
      |               ^~~
      |               |
      |               const char*
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:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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", a + b);
        }
        if(op == '-') {
            printf("%d", a - b);
        }
        if(op == '*') {
            printf("%d", a * b);
        }
        if(op == '/') {
            printf("%d\n", a / b);
        }
        else 
            printf("\n");
  } 
  return 0;
}





Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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", a + b);
        }
        if(op == '-') {
            printf("%d", a - b);
        }
        if(op == '*') {
            printf("%d", a * b);
        }
        if(op == '/') {
            printf("%d\n", a / b);
        }
        else 
            printf("");
  } 
  return 0;
}





Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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", a + b);
        }
        if(op == '-') {
            printf("%d", a - b);
        }
        if(op == '*') {
            printf("%d", a * b);
        }
        if(op == '/') {
            printf("%d", a / b);
        }
        else 
            printf("");
  } 
  return 0;
}





Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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("");
  } 
  return 0;
}





Compiler output:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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:
a.cc:4:1: error: extended character 　 is not valid in an identifier
    4 | 　int a, b, i;
      | ^
a.cc: In function 'int main()':
a.cc:4:1: error: '\U00003000int' was not declared in this scope
    4 | 　int a, b, i;
      | ^~~~~
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0; i<1000; i++){
      |       ^
a.cc:7:22: error: 'a' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                      ^
a.cc:7:31: error: 'b' was not declared in this scope
    7 |   scanf("%d %c %d", &a, &op, &b);
      |                               ^
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;
		if(op == '-') cout << a - b << endl;
		if(op == '*') cout << a * b << endl;
		if(op == '/') cout << a / b << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if(op == "+") cout << a + b << endl;
      |                    ~~~^~~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <sstream>
#include <istream>

int main(void){
	int i, length, a, b;
	char buf[32];
	std::stringstream ss;
	std::string interpreter[3], str;
	while(true){
		fgets(buf, sizeof(buf), stdin);
		length = strlen(buf);
		buf[length-1] = '\0';
		ss << buf;
		i = 0;
		while(std::getline(ss, str, ' ')){
			interpreter[i++] = str;
		}

		if(interpreter[1].c_str()[0]=='?') break;
		a = atoi(interpreter[0].c_str());
		b = atoi(interpreter[2].c_str());
		if(interpreter[1].c_str()[0]=='+'){
			printf("%d\n",a+b);
		}
		else if(interpreter[1].c_str()[0]=='-'){
			printf("%d\n",a-b);
		}
		else if(interpreter[1].c_str()[0]=='*'){
			printf("%d\n",a*b);
		}
		else if(interpreter[1].c_str()[0]=='/'){
			printf("%d\n",a/b);
		}

		ss.str("");
		ss.clear(std::stringstream::goodbit);
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: 'strlen' was not declared in this scope
   13 |                 length = strlen(buf);
      |                          ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <sstream>
  +++ |+#include <cstring>
    4 | #include <istream>
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <istream>

int main(void){
	int i, length, a, b;
	char buf[32];
	std::stringstream ss;
	std::string interpreter[3], str;
	while(true){
		fgets(buf, sizeof(buf), stdin);
		length = strlen(buf);
		buf[length-1] = '\0';
		ss << buf;
		i = 0;
		while(std::getline(ss, str, ' ')){
			interpreter[i++] = str;
		}

		if(interpreter[1].c_str()[0]=='?') break;
		a = atoi(interpreter[0].c_str());
		b = atoi(interpreter[2].c_str());
		if(interpreter[1].c_str()[0]=='+'){
			printf("%d\n",a+b);
		}
		else if(interpreter[1].c_str()[0]=='-'){
			printf("%d\n",a-b);
		}
		else if(interpreter[1].c_str()[0]=='*'){
			printf("%d\n",a*b);
		}
		else if(interpreter[1].c_str()[0]=='/'){
			printf("%d\n",a/b);
		}

		ss.str("");
		ss.clear(std::stringstream::goodbit);
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: 'strlen' was not declared in this scope
   14 |                 length = strlen(buf);
      |                          ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <sstream>
  +++ |+#include <cstring>
    5 | #include <istream>
Language: C++

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

int main() {
  int a, op, b;
  while(true)[
    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 cout << a / b << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: warning: capture of variable 'std::cin' with non-automatic storage duration
    7 |     cin >> a >> op >> b;
      |     ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::istream std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:8: error: expected ',' before '>>' token
    7 |     cin >> a >> op >> b;
      |        ^~~
      |        ,
a.cc:7:9: error: expected identifier before '>>' token
    7 |     cin >> a >> op >> b;
      |         ^~
a.cc:7:24: error: expected ']' before ';' token
    7 |     cin >> a >> op >> b;
      |                        ^
      |                        ]
a.cc: In lambda function:
a.cc:7:24: error: expected '{' before ';' token
a.cc: At global scope:
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before 'cout'
   11 |     else if (op == '/' cout << a / b << endl;
      |                       ^~~~~
      |                       ;
a.cc:12:5: error: expected primary-expression before 'else'
   12 |     else break;
      |     ^~~~
a.cc:11:46: error: expected ')' before 'else'
   11 |     else if (op == '/' cout << a / b << endl;
      |             ~                                ^
      |                                              )
   12 |     else break;
      |     ~~~~
Language: C++

#include<iostream>
using namespace std;
  int n,m;
  char op;
  while(cin >> n >> op >> m&& op!='?'){
    if(op=='+')cout << a(n,m) << endl;
    else if(op=='-')cout << b(n,m) << endl;
    else if(op=='*')cout << c(n,m) << endl;
    else if(op=='/')cout << d(n,m) << endl;
  }
}


Compiler output:
a.cc:5:3: error: expected unqualified-id before 'while'
    5 |   while(cin >> n >> op >> m&& op!='?'){
      |   ^~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int a(int a,int b){return a+b;}
int b(int a,int b){return a-b;}
int c(int a,int b){return a*b;}
int d(int a,int b){return a/b;}
int main(){
  int n,m;
  char op;
  while(cin >> n >> op >> m&& op!='?'){
    if(op=='+')cout << a(n,m) << endl;
    else if(op=='-')cout << b(n,m) << endl;
    else if(op=='*')cout << c(n,m) << endl;
    else if(op=='/')cout << d(n,m) << endl;
  }


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

#include<iostream>
using namespace std;
int main(){
int x, y;
char op;
for (int i = 0; ; i++){
cin >> x >> op >> y;
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;
else if (op=='?') break;
}

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