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

import java.io.*;
import java.util.*;

public class test
{

	public static void main(String[] args)
	{
		 Scanner scan = new Scanner(System.in);
		 int first = scan.nextInt();
		 String op = scan.next();
		 int second = scan.nextInt();
		 if(op.equals("+")) {
			 System.out.println(first + second);
		 } else {
			 System.out.println(first - second);
		 }
	}

}

Compiler output:
Main.java:4: error: class test is public, should be declared in a file named test.java
public class test
       ^
1 error
Language: Java




		
			   Scanner s = new Scanner(System.in);
			   int a = s.nextInt();
			   String op = s.next();
			   int b = s.nextInt();
			   if(op.equals("+")){
			   System.out.println(a + b);
			   }
			   else if(op.equals("-")){
			    System.out.println(a - b);
			   }

			  return;
			
		


Compiler output:
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
			   Scanner s = new Scanner(System.in);
			   ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
			   if(op.equals("+")){
			   ^
Main.java:11: error: class, interface, enum, or record expected
			   }
			   ^
Main.java:14: error: class, interface, enum, or record expected
			   }
			   ^
4 errors
Language: Java

import java.util.Scanner;


	public static void main(String[] args) {
		
			   Scanner s = new Scanner(System.in);
			   int a = s.nextInt();
			   String op = s.next();
			   int b = s.nextInt();
			   if(op.equals("+")){
			   System.out.println(a + b);
			   }
			   else if(op.equals("-")){
			    System.out.println(a - b);
			   }

			  return;
			
		
	}


Compiler output:
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;

public class OpQuestion {
	public static void main(String[] args) {
		
			   Scanner s = new Scanner(System.in);
			   int a = s.nextInt();
			   String op = s.next();
			   int b = s.nextInt();
			   if(op.equals("+")){
			   System.out.println(a + b);
			   }
			   else if(op.equals("-")){
			    System.out.println(a - b);
			   }

			  return;
			
		
	}
}

Compiler output:
Main.java:3: error: class OpQuestion is public, should be declared in a file named OpQuestion.java
public class OpQuestion {
       ^
1 error
Language: Java

import java.util.*;
public class OP{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
	    int A=sc.nextInt();
	    String OP=sc.next();
	    int B=sc.nextInt();
	    int K=0;
	    switch(OP) {
	    case "+":
	        K=A+B;
	    	System.out.println(K);
	    	break;
	    case "-":
	    	K=A-B;
	    	System.out.println(K);
	    }
	    
	}
}

Compiler output:
Main.java:2: error: class OP is public, should be declared in a file named OP.java
public class OP{
       ^
1 error
Language: C++

# include <stdio.h>
#include <stdlib.h>
int main()
{
	int a,b;
	char c;
	scanf_s("%d",&a);
	c = getchar();
	scanf_s("%d", &b);
	int e, f;
	if (c==43)
	{
		e = a + b;
		printf("%d\n", e);
	}
	if (c==45)
	{
		f = a - b;
		printf("%d\n", f);
	}
	system("pause");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |         scanf_s("%d",&a);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>

int main()  {
	int A op B;
	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:4:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'op'
    4 |         int A op B;
      |               ^~
main.c:4:15: error: unknown type name 'op'
main.c:5:13: error: 'op' undeclared (first use in this function)
    5 |         if (op==-)  {
      |             ^~
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:18: error: expected expression before ')' token
    5 |         if (op==-)  {
      |                  ^
main.c:6:32: error: 'A' undeclared (first use in this function)
    6 |                 printf ("%d\n",A-B); }
      |                                ^
main.c:7:23: error: expected expression before ')' token
    7 |         else if (op==+) {
      |                       ^
Language: C

#include<stdio.h>
#include<math.h>
int main(){
  long n;
  scanf(“%ld”,&n);
  long a[n];
  int ans=1;
  for(long i=0;i<n;i++){
      scanf(“%ld”,&a[i]);
  }
  int chek=0;
  for(long i=0;i<(n/2)+n%2;i++){
      chek=0;
      if(n%2==1){
          for(long j=0;j<n;j++){
              if(i==0){
                  if(i==a[j])chek+=2;
              }else{
                  if(i*2==a[j])chek+=1;
              }
          }

      }else{
          for(long j=0;j<n;j++){
              if(i*2+1==a[j])chek+=1;
          }
      }
      if(chek!=2){
                  ans=0;
                  break;
              }
  }
  if(ans==0){
      printf(“%d\n”,ans);
  }else{
      long x=pow(10,9)+7;
      unsigned long y=pow(2,(n-n%2)/2);
      y=y%x;
      printf(“%ld\n”,y);
  }

}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: stray '\342' in program
    5 |   scanf(<U+201C>%ld<U+201D>,&n);
      |         ^~~~~~~~
main.c:5:10: error: expected expression before '%' token
    5 |   scanf(“%ld”,&n);
      |          ^
main.c:5:13: error: stray '\342' in program
    5 |   scanf(<U+201C>%ld<U+201D>,&n);
      |                    ^~~~~~~~
main.c:9:13: error: stray '\342' in program
    9 |       scanf(<U+201C>%ld<U+201D>,&a[i]);
      |             ^~~~~~~~
main.c:9:14: error: expected expression before '%' token
    9 |       scanf(“%ld”,&a[i]);
      |              ^
main.c:9:17: error: stray '\342' in program
    9 |       scanf(<U+201C>%ld<U+201D>,&a[i]);
      |                        ^~~~~~~~
main.c:34:14: error: stray '\342' in program
   34 |       printf(<U+201C>%d\n<U+201D>,ans);
      |              ^~~~~~~~
main.c:34:15: error: expected expression before '%' token
   34 |       printf(“%d\n”,ans);
      |               ^
main.c:34:17: error: stray '\' in program
   34 |       printf(“%d\n”,ans);
      |                 ^
main.c:34:19: error: stray '\342' in program
   34 |       printf(<U+201C>%d\n<U+201D>,ans);
      |                          ^~~~~~~~
main.c:39:14: error: stray '\342' in program
   39 |       printf(<U+201C>%ld\n<U+201D>,y);
      |              ^~~~~~~~
main.c:39:15: error: expected expression before '%' token
   39 |       printf(“%ld\n”,y);
      |               ^
main.c:39:18: error: stray '\' in program
   39 |       printf(“%ld\n”,y);
      |                  ^
main.c:39:20: error: stray '\342' in program
   39 |       printf(<U+201C>%ld\n<U+201D>,y);
      |                           ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main() {
	int a,op,b;
  cin >> a >> op >> b;
  if (op == "+") {
	cout << a + b << endl;
  } else {
  	cout << a - b << endl;
  }
}


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

#include<iostream>
using namespace std;

int main() {
	int a,op,b;
  cin >> a >> op >> b;
  if (op == "+") {
	cout << a + b << endl;
  } else if (op == "-") {
  	cout << a - b << endl;
  }
}


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

#include<iostream>
using namespace std;

int main() {
	int a,op,b;
  cin >> a >> op >> b;
  if (op == +) {
	cout << a + b << endl;
  } else if (op == -) {
  	cout << a - b << endl;
  }
}

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

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

Compiler output:
main.c: In function 'main':
main.c:12:27: error: expected ';' before 'return'
   12 |         printf("%d\n",a-b)
      |                           ^
      |                           ;
   13 |     return 0;
      |     ~~~~~~
Language: Java

import java.util.Scanner;

public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int int1 = sc.nextInt();
		String str = sc.next();
		int int2 = sc.nextInt();

		if(str.equals("+")){
			System.out.println(int1 + int2);
		}else{
			System.out.println(int1 - int2);
		}
	}
}

Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C++

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

int main() {
  string op;
  int A,B;
  cin >> A >> op >> B;
  if(op ==“+”){
  cout << A+B<< endl;
}else{
cout<< A-B << endl;
}

Compiler output:
a.cc:8:11: error: extended character “ is not valid in an identifier
    8 |   if(op ==“+”){
      |           ^
a.cc:8:13: error: extended character ” is not valid in an identifier
    8 |   if(op ==“+”){
      |             ^
a.cc: In function 'int main()':
a.cc:8:11: error: '\U0000201c' was not declared in this scope
    8 |   if(op ==“+”){
      |           ^
a.cc:8:13: error: '\U0000201d' was not declared in this scope
    8 |   if(op ==“+”){
      |             ^
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
  int a,b;
  char str;
  cin >> a >> str >> b;
  if(str=="+"){
    cout << a+b << endl;
  }
  else{
    cout << a-b << endl;
  }
}


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

#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void)
{
	//整数//
	int a, b;

	//結果//
	int result;

	//演算子//
	char op;

	//入力//
	scanf_s("%d", &a);
	scanf_s(" %c", &op);
	scanf_s("%d", &b);

	//出力//
	if (op == '+') {
		result = a + b;
		printf("%d", result);		
	}

	else {
		result = a - b;
		printf("%d", result);
	}

	return 0;

}

Compiler output:
main.c:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void)
{
	//整数//
	int a, b;

	//結果//
	int result;

	//演算子//
	char op;

	//入力//
	scanf_s("%d", &a);
	scanf_s(" %c", &op);
	scanf_s("%d", &b);

	//出力//
	if (op == '+') {
		result = a + b;
		printf("%d", result);		
	}

	else {
		result = a - b;
		printf("%d", result);
	}

	return 0;

}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

include <iostream>

int main() {
  int A, B;
  char op;
  std::cin >> A >> op >> B;

  int eval = 0;
  if ( op == '+' ) {
    eval = A + B;
  } else if ( op == '-' ) {
    eval = A - B;
  }
  std::cout << eval << std::endl;

  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        String op = sc.next();
        int B = sc.nextInt();
        int ans;
        if(op.chatAt(0)=='+') ans = A+B;
        else ans = A-B;
        System.out.println(ans);
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
        if(op.chatAt(0)=='+') ans = A+B;
             ^
  symbol:   method chatAt(int)
  location: variable op of type String
1 error
Language: C++

using System;

public class Hey{
    public static void Main(){
        var line = Console.ReadLine().Split(' ');
        if(line[1] == '+') Console.WriteLine(line[0]+line[2]);
        else Console.WriteLine(line[0]-line[2]);
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Hey{
      | ^~~~~~
Language: C++

#include <string.h>
#include <iostream>
using namespace std;
	int num1, num2;
	char s[1];
	cin >> num1 >> s >> num2;
	if (strcmp(s, "+")==0) {
		cout << num1 + num2 << endl;
	}
	if (strcmp(s, "-") == 0) {
		cout << num1 - num2 << endl;
	}

Compiler output:
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin >> num1 >> s >> num2;
      |         ^~~
a.cc:7:9: error: expected unqualified-id before 'if'
    7 |         if (strcmp(s, "+")==0) {
      |         ^~
a.cc:10:9: error: expected unqualified-id before 'if'
   10 |         if (strcmp(s, "-") == 0) {
      |         ^~
Language: C++

int num1, num2;
	char s[1];
	cin >> num1 >> s >> num2;
	if (strcmp(s, "+")==0) {
		cout << num1 + num2 << endl;
	}
	if (strcmp(s, "-") == 0) {
		cout << num1 - num2 << endl;
	}

Compiler output:
a.cc:3:9: error: 'cin' does not name a type
    3 |         cin >> num1 >> s >> num2;
      |         ^~~
a.cc:4:9: error: expected unqualified-id before 'if'
    4 |         if (strcmp(s, "+")==0) {
      |         ^~
a.cc:7:9: error: expected unqualified-id before 'if'
    7 |         if (strcmp(s, "-") == 0) {
      |         ^~
Language: C++

#include <iostream>
using namespace std;
int main() {
	int num1, num2;
	char s[1];
	//scanf("%d %s %d", &num1, s, &num2);
	cin >> num1 >> s >> num2;
	if (strcmp(s, "+")==0) {
		cout << num1 + num2 << endl;
	}
	else {
		cout << num1 - num2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'strcmp' was not declared in this scope
    8 |         if (strcmp(s, "+")==0) {
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void main() {
	int num1, num2;
	char s[1];
	scanf("%d %s %d", &num1, s, &num2);
	if (strcmp(s, "+")==0) {
		printf("%d", num1 + num2);
	}
	else {
		printf("%d", num1 - num2);
	}

}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main() {
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <climits>

#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())


//INT_MAX
//INT_MIN
//LLONG_MAX
//LLONG_MIN
//DBL_MIN
//DBL_MAX
//LDBL_MIN
//LDBL_MAX

using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    ll a, b:
    char op;
    cin >> a >> op >> b;
    if (op == '+') {
        cout << a + b << endl;
    }else{
        cout << a - b << endl;
    }
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:28:12: error: expected initializer before ':' token
   28 |     ll a, b:
      |            ^
a.cc:30:17: error: 'op' was not declared in this scope
   30 |     cin >> a >> op >> b;
      |                 ^~
a.cc:30:23: error: 'b' was not declared in this scope
   30 |     cin >> a >> op >> b;
      |                       ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a, b;
  string op;
  cin >> a >> op >> b;
  switch(op){
    case '+':
      cout << a+b << endl;
      break;
    case '-':
      cout << a-b << endl;
      break;
  }
  return 0;
}


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

#include<iostream>
using namespace std:

int main(){
  int a, b;
  string op;
  cin >> a >> op >> b;
  switch(op){
    case '+':
      cout << a+b << endl;
      break;
    case '-':
      cout << a-b << endl;
      break;
  }
  return 0;
}

Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    int a,b,op;
    cin >> a >> b >> op;
    if(op == '+') cout << a += b << endl;
    else cout << a -= b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |     if(op == '+') cout << a += b << endl;
      |                                ~~^~~~~~~
a.cc:9:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |     else cout << a -= b << endl;
      |                       ~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{while(1)
 {cout<<“AC”<<endl;
 }
 return 0;}


Compiler output:
a.cc:5:9: error: extended character “ is not valid in an identifier
    5 |  {cout<<“AC”<<endl;
      |         ^
a.cc:5:9: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:9: error: '\U0000201cAC\U0000201d' was not declared in this scope
    5 |  {cout<<“AC”<<endl;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    char c;
    cin>>a>>c>>b;
    if(c=='+'){
        cout<<a+b<<endl;
    }
    else{
        cout<<a-b<<endl;
    }
    return 0;！
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: '\U0000ff01' was not declared in this scope
   14 |     return 0;！
      |              ^~
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before ')' token
    8 |   if(b==+){cout<<a+c<<endl;}
      |          ^
Language: C++

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

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

#include <iostream>
#include <cstdlib>
#include <cstring>

int main()
{
    int m, n;
    string op;

    std::cin >> m >> op >> n;

    if ( !strcmp(op, "+") ) std::cout << (m + n) << std::endl;
    if ( !strcmp(op, "-") ) std::cout << (m - n) << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
    8 |     string op;
      |     ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:22: error: 'op' was not declared in this scope
   10 |     std::cin >> m >> op >> n;
      |                      ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    char c;
    cin>>a>>c>>b;
    if(c=='+')
        cout<<a+b<<endl;
    else
        cout<<a-b<<endl;
    return 0;！
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
   12 |     return 0;！
      |              ^~
Language: C++

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

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

  cin >> a >> op >> p;

  cout << (op=='+'?a+b:a-b) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'b' was not declared in this scope
   11 |   cout << (op=='+'?a+b:a-b) << endl;
      |                      ^
Language: C++

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

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

  cin >> a >> op >> p;

  cout << (OP=='+'?a+b:a-b) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'OP' was not declared in this scope; did you mean 'op'?
   11 |   cout << (OP=='+'?a+b:a-b) << endl;
      |            ^~
      |            op
a.cc:11:22: error: 'b' was not declared in this scope
   11 |   cout << (OP=='+'?a+b:a-b) << endl;
      |                      ^
Language: C++

#include<stdio.h>
#define INF 1000000000

int main(void){

  int A,B;
  int res;
  char op;

  printf("enter two numbers and an operand\n");
  printf("A = ");
  scanf("%d",&A);
  while(0<=A && A <= INF){
    printf("out of range\n");
    scanf("%d",&A);
  }
  printf("op is");
  op = getchar();
  while(op == '+' || op == '-'){
    print("Unkown error!\n");
    op = getchar();
  }
  printf("\nB = ");
  scanf("%d",&B);
  while(0<=B && B <= INF){
    printf("out of range\n");
    scanf("%d",&B);
  }

  if(op == '+'){
    res = A + B;
    printf("The answer is %d\n",res);
  }
  else if(op == '-'){
    res = A - B;
    printf("The answer is %d\n",res);
  }
  else{
    printf("error!\n");
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
   20 |     print("Unkown error!\n");
      |     ^~~~~
      |     printf
Language: C++

#include<stdio.h>
#define INF 1000000000

int main(void){

  int A,B;
  int res;
  char op;

  printf("enter two numbers and an operand\n");
  printf("A = ");
  scanf("%d",&A);
  while(0<=A && A <= INF){
    printf("out of range\n");
    scanf("%d",&A);
  }
  printf("op is");
  scanf("%c",op);
  while(op == '+' || op == '-'){
    print("Unkown error!\n");
    scanf("%c",op);
  }
  printf("\nB = ");
  scanf("%d",&B);
  while(0<=B && B <= INF){
    pritnf("out of range\n");
    scanf("%d",&B);
  }

  if(op == '+'){
    res = A + B;
    printf("The answer is %d\n",res);
  }
  if else(op == '-'){
    res = A - B;
    printf("The answer is %d\n",res);
  }
  else{
    printf("error!\n");
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'print' was not declared in this scope; did you mean 'printf'?
   20 |     print("Unkown error!\n");
      |     ^~~~~
      |     printf
a.cc:26:5: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   26 |     pritnf("out of range\n");
      |     ^~~~~~
      |     printf
a.cc:34:6: error: expected '(' before 'else'
   34 |   if else(op == '-'){
      |      ^~~~
      |      (
a.cc:38:3: error: 'else' without a previous 'if'
   38 |   else{
      |   ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
int a,b,ans;
char c;
int main()
{
    cin>>a>>c>>b;
    if(c=='+') ans=a+b;
    else ans=a-b;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin>>a>>c>>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:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     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:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     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>
int a,b,ans;
char c;
int main()
{
    cin>>a>>c>>b;
    if(f=='+') ans=a+b;
    else ans=a-b;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>a>>c>>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:7:8: error: 'f' was not declared in this scope
    7 |     if(f=='+') ans=a+b;
      |        ^
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     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:9:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     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<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    char h;
    cin>>a>>h>>b;
    if(h=='+')
        cout<<a+b<<endl;
    else
        cout<<a-b<<endl;
    return 0;！


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: '\U0000ff01' was not declared in this scope
   12 |     return 0;！
      |              ^~
a.cc:12:16: error: expected '}' at end of input
   12 |     return 0;！
      |                ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

#include <stdio.h>

int main(void) {
  int a;
  char e;
  int b;
  scanf("%d",&a);
  scanf("%c",&e);
  scanf("%d",&b);
  if(e=='+'){
  printf("%d",a+b);}
 if(e=='-'{
    printf("%d",a-b);}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: expected ')' before '{' token
   12 |  if(e=='-'{
      |    ~      ^
      |           )
main.c:15:1: error: expected expression before '}' token
   15 | }
      | ^
Language: C++

#include <string>
#include <sstream>
#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string op;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> a >> op >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:15: error: 'op' was not declared in this scope
    8 |   cin >> a >> op >> b;
      |               ^~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout << a + b << 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:10:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   cout << a + b << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from a.cc:2:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout << a-b <<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:12:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout << a-b <<endl;
      |                 ^~~~
      |                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
  string op;
  int A, B;
  cin A >> op >> B;
  
  if(op=="+"){ 
    cout << A+B << endl;
  }
    else{cout << A-B << endl;}
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'A'
    7 |   cin A >> op >> B;
      |      ^~
      |      ;
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
	int x;
	cin>>x;
	pp[y]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:12:5: error: 'y' was not declared in this scope
   12 | for(y=0;y<N;y++){
      |     ^
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(y=0;y<N;y++){
	int x;
	cin>>x;
	pp[y]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:12:5: error: 'y' was not declared in this scope
   12 | for(y=0;y<N;y++){
      |     ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(y=0;y<N;y++)cin>>rr[y];
	int x;
	cin>>x;
	rr[p]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:13:5: error: 'y' was not declared in this scope
   13 | for(y=0;y<N;y++)cin>>rr[y];
      |     ^
a.cc:16:12: error: 'p' was not declared in this scope
   16 |         rr[p]=x;
      |            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
for(p=0;p<M;p++){
	int x;
	cin>>x;
	rr[p]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:14:5: error: 'p' was not declared in this scope
   14 | for(p=0;p<M;p++){
      |     ^
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
int rr[N];
for(int p=0;p<N;p++)cin>>rr[p];
y=p;
	int x;
	cin>>x;
	rr[p]=x;
	rr[N]=PP[N];
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:14:1: error: 'y' was not declared in this scope
   14 | y=p;
      | ^
a.cc:14:3: error: 'p' was not declared in this scope
   14 | y=p;
      |   ^
a.cc:18:15: error: 'PP' was not declared in this scope; did you mean 'pp'?
   18 |         rr[N]=PP[N];
      |               ^~
      |               pp
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int pp[N];
for(int i=0;i<N;i++)cin>>PP[i];
int M;
int o[M];
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
	int x;
	cin>>x;
	pp[p]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'PP' was not declared in this scope; did you mean 'pp'?
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |                          ^~
      |                          pp
a.cc:13:1: error: 'y' was not declared in this scope
   13 | y=p;
      | ^
a.cc:13:3: error: 'p' was not declared in this scope
   13 | y=p;
      |   ^
Language: C++

#include<iostream>
using namespace std;

int main(){
int N;
cin>>N;
int 
for(int i=0;i<N;i++)cin>>PP[i];
int M;
for(int y=0;y<M;y++)cin>>o[y];
for(int p=0;p<N;p++)cin>>pp[p];
y=p;
	int x;
	cin>>x;
	pp[p]=x;
	for(int g=0;g<N;g++){
		int z;
		z=z+pp[g];
		cout<<z<<endl;
	}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      | ^~~
a.cc:8:13: error: 'i' was not declared in this scope
    8 | for(int i=0;i<N;i++)cin>>PP[i];
      |             ^
a.cc:10:26: error: 'o' was not declared in this scope
   10 | for(int y=0;y<M;y++)cin>>o[y];
      |                          ^
a.cc:11:26: error: 'pp' was not declared in this scope; did you mean 'p'?
   11 | for(int p=0;p<N;p++)cin>>pp[p];
      |                          ^~
      |                          p
a.cc:12:1: error: 'y' was not declared in this scope
   12 | y=p;
      | ^
a.cc:12:3: error: 'p' was not declared in this scope
   12 | y=p;
      |   ^
a.cc:15:9: error: 'pp' was not declared in this scope
   15 |         pp[p]=x;
      |         ^~
Language: C++

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

int main() {
int A, B;
  char  op;
  cin >> A >> op >> B;

if (op == '+'){
A+=B;
cout << A << endl;
}

else {
A-=B;
cout << A << endl;
}

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

import java.util.Scanner;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int op = sc.next();
		int b = sc.nextInt();
		if(op=="+"){
			System.out.println(a+b);
		}else{
			System.out.println(a-b);
		}
	}
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to int
		int op = sc.next();
		                ^
Main.java:8: error: bad operand types for binary operator '=='
		if(op=="+"){
		     ^
  first type:  int
  second type: String
2 errors
Language: Java

import java.util.Scanner;
public Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		String OP = sc.next();
		int B = sc.nextInt();
		if (OP.endsWith("+"))  System.out.println(A+B);
		else  System.out.println(A-B);
	}
}


Compiler output:
Main.java:2: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

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

int main() {
  string c;
  cin >> c;
if(c == "a" || c== "i" || c== "u" || c== "e" || c== "o"){
      cout << "vowel" << endl;

}

else{
cout << "consonant" << endl;
}



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

int main() {
  int a,b;
  string op;
if(op=="+"||op=="-")
  cout << a << op << b << endl;
}



Compiler output:
a.cc:22:5: error: redefinition of 'int main()'
   22 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
using namespace std;
int a;
char x;
int b;
cin>>a>>x>>b;
if(x=='+')
cout<<a+b<<endl;
else
cout<<a-b<<endl;
}

Compiler output:
a.cc:11:1: error: 'cin' does not name a type
   11 | cin>>a>>x>>b;
      | ^~~
a.cc:12:1: error: expected unqualified-id before 'if'
   12 | if(x=='+')
      | ^~
a.cc:14:1: error: expected unqualified-id before 'else'
   14 | else
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long a,b;
  char op;
  cin>>a>>op>>b;
  if(op=='+'){
    cout<<a+b<<endl;
  }
  if(op=='-'){
    cour<<a-b<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cour' was not declared in this scope
   11 |     cour<<a-b<<endl;
      |     ^~~~
Language: C++

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

int main() {
	long long a, b;
	char n;
	int >> a >> n >> b;
	if(n == '+'){
		cout << a + b << endl;
		return 0;
	}
	cout << a - b << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected unqualified-id before '>>' token
    7 |         int >> a >> n >> b;
      |             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main{
  int a,b;
  char op;
  cin>>a>>op>>b;
  if(op=='+')cout<<a+b<<endl;
  else cout<<a-b<<endl;
  return 0;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int a,b;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin>>a>>op>>b;
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'if'
    7 |   if(op=='+')cout<<a+b<<endl;
      |   ^~
a.cc:8:3: error: expected unqualified-id before 'else'
    8 |   else cout<<a-b<<endl;
      |   ^~~~
a.cc:9:3: error: expected unqualified-id before 'return'
    9 |   return 0;
      |   ^~~~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

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

int main(void) {
  int a, b;
  char op;
  cin >> a >> op >> b;
  if(op == '+') cout << a+b <<endl;
  else if(op =='-') cout << a-b <<endl;
}

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

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

int main(void) {
  int a, b;
  char op;
  cin >> a >> op >> b;
  if(op == '+') cout << a+b <<endl;
  else(op =='-') cout << a-b <<endl;
}

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

int a,b;
string op;

cin>> a >> op >> b;

if(op == "+")
  cout << a+b << endl;

else
  cout << a-b << endl;

Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string op;
      | ^~~~~~
a.cc:4:1: error: 'cin' does not name a type
    4 | cin>> a >> op >> b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
    6 | if(op == "+")
      | ^~
a.cc:9:1: error: expected unqualified-id before 'else'
    9 | else
      | ^~~~
Language: C++

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

int main() {
  int A,B;
  string op;
  cin >> A >> op >> B;
  if(op = "+") cout << A + B;
  else cout << A - B;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(op = "+") cout << A + B;
      |      ~~~^~~~~
      |         |
      |         std::__cxx11::basic_string<char>
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{
    cout << (a - b) << endl;
  }
  return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(void){
	int a, b;
	string op;
	cin >> a >> op >> b;
	cout << (op=="+") ? a+b : a-b << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |         cout << (op=="+") ? a+b : a-b << endl;
      |                                   ~~~~^~~~~~~
Language: C++

#include <string>
using namespace std;

  int a , b ;
  string op ;
  cin >> a >> op >> b ;
  if ( op == "+"){
    cout << a + b << endl ;
  }else{
    cout << a - b << endl ;
  }

Compiler output:
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin >> a >> op >> b ;
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'if'
    7 |   if ( op == "+"){
      |   ^~
a.cc:9:4: error: expected unqualified-id before 'else'
    9 |   }else{
      |    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a >> op >> b ;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << a + b << endl ;
      |     ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:22: error: 'endl' was not declared in this scope
    8 |     cout << a + b << endl ;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << a - b << endl ;
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:22: error: 'endl' was not declared in this scope
   10 |     cout << a - b << endl ;
      |                      ^~~~
a.cc:10:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin >> a >> op >> b ;
      | ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << a + b << endl ;
      |   ^~~~
a.cc:8:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:20: error: 'endl' was not declared in this scope
    8 |   cout << a + b << endl ;
      |                    ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << a - b << endl ;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   cout << a - b << endl ;
      |                    ^~~~
a.cc:10:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <string>
using namespace std;
int a , b ;
string op ;
cin >> a >> op >> b ;
if ( op == "+")
  cout << a + b << endl ;
else
  cout << a - b << endl ;

Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >> a >> op >> b ;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
    6 | if ( op == "+")
      | ^~
a.cc:8:1: error: expected unqualified-id before 'else'
    8 | else
      | ^~~~
Language: C++

#include <string>
using namespace std;
int a , b ;
string op ;
cin >> a >> op >> b ;
if ( op == "+")
  {
  cout << a + b << endl ;
  }
else
 {
  cout << a - b << endl ;
 }

Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >> a >> op >> b ;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
    6 | if ( op == "+")
      | ^~
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else
      | ^~~~
Language: C++

int a , b ;
string op ;
cin >> a >> op >> b ;
if ( op == "+")
  cout << a + b << endl ;
else
  cout << a - b << endl ;

Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string op ;
      | ^~~~~~
a.cc:3:1: error: 'cin' does not name a type
    3 | cin >> a >> op >> b ;
      | ^~~
a.cc:4:1: error: expected unqualified-id before 'if'
    4 | if ( op == "+")
      | ^~
a.cc:6:1: error: expected unqualified-id before 'else'
    6 | else
      | ^~~~
Language: C++

int a,b;
string op;
cin>> a >> op >> b;
if ( op == "+" )
     cout<< a + b <<endl;
else
     cout<< a - b <<endl;

Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string op;
      | ^~~~~~
a.cc:3:1: error: 'cin' does not name a type
    3 | cin>> a >> op >> b;
      | ^~~
a.cc:4:1: error: expected unqualified-id before 'if'
    4 | if ( op == "+" )
      | ^~
a.cc:6:1: error: expected unqualified-id before 'else'
    6 | else
      | ^~~~