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

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

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

  if(op=='+'){
    a=atoi(A);
    b=atoi(B);
    ans=a+b;
    cout << ans;
  }else{
    a=atoi(A);
    b=atoi(B);
    ans=a-b;
    cout <<ans;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   10 |     a=atoi(A);
      |            ^
      |            |
      |            char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:11:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   11 |     b=atoi(B);
      |            ^
      |            |
      |            char
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:15:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   15 |     a=atoi(A);
      |            ^
      |            |
      |            char
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:16:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   16 |     b=atoi(B);
      |            ^
      |            |
      |            char
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
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<<endl;
  }
  else {
    cout<<a-b<<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected primary-expression before ')' token
    8 |   if (op==+) {
      |            ^
Language: Java

5 - 7
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			solveA();
			//			 solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numA = nextInt();
		char operand = next().charAt(0);
		int numB = nextInt();

		int res = operand == '+' ? numA + numB : numA - numB;

		out.println(res);
	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
5 - 7
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStream;
^
Main.java:4: error: class, interface, enum, or record expected
import java.io.PrintWriter;
^
Main.java:5: error: class, interface, enum, or record expected
import java.util.NoSuchElementException;
^
4 errors
Language: C++

a, s, b = map(str, input().split())
a = int(a)
b = int(b)
if s == '+':
    print(a + b)
else:
    print(a - b)



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

#include <iostream>

using namespase std;

int main(){
  int A, B;
  char op;
  cin >> A >> op >> B;
  if(op == '+'){
    cout << A + B << endl;
  }else if(op == '-'){
    cout << A - B << endl;
  }
  return 0;
}
      

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespase'
    3 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
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: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 << 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:22: 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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:5: 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:22: 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 <stdio.h>

int main (){

    int n;
    int t[101];
    int m;
    int p[101];
    int x[101];
    int sum = 0;
    int i;

    scanf("%d" ,&n);

    for( i = 0; i < n; i++) {

        scanf("%d" &t[i]);
        sum = sum + t[i];
    }

    scanf("%d" ,&m);

    for( i = 0; i < m; i++) {
        
        scanf("%d %d" ,&p[i] ,&x[i]);
    }

    for( i = 0; i < m; i++) {
        
        printf("%d\n" ,sum = t[p[i] - 1] + x[i]);
    }
    
    return 0;
    
}

Compiler output:
main.c: In function 'main':
main.c:17:20: error: invalid operands to binary & (have 'char *' and 'int')
   17 |         scanf("%d" &t[i]);
      |               ~~~~ ^~~~~
      |               |      |
      |               char * int
Language: C++

#include<iostream>
#include<string>
#include <algorithm>
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:11:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(op == "+"){
      |      ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int A,B;
	string op;
	cin>>A>>op>>B;
	cout<<A op B<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'op'
    8 |         cout<<A op B<<endl;
      |                ^~~
      |                ;
Language: Java

/*
この問題はABC_50_Aである
opが"+"ならaとbを足し、"-"ならaとbを引く
*/
import java.util.*;

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


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

/*
この問題はABC_50_Aである
opが"+"ならaとbを足し、"-"ならaとbを引く
*/
import java.util.*;

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


Compiler output:
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.*;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
    7 | public class Addition_and_Subtraction_Easy{
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int n,m,h,w,a,b,c,d;
string str;

signed main(){

  char gl;
  cin >> a >> gl > >b; 
  cout << (gl=='+' ? a+b : a-b) fin;
                         
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: expected primary-expression before '>' token
   48 |   cin >> a >> gl > >b;
      |                    ^
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
#include <ios>
#include <iomanip>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRTV(v) sort(v.begin(),v.end())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;
typedef tuple<ll,ll,ll> Tl;

int atcoder(){
    //入力
    ll a,c;
  	string b;
    cin >> a >> b >> c;
    
    if(b="+") cout << a+c << ENT;
    else cout << a-c << ENT;
    return 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Compiler output:
a.cc: In function 'int atcoder()':
a.cc:38:9: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   38 |     if(b="+") cout << a+c << ENT;
      |        ~^~~~
      |         |
      |         std::__cxx11::basic_string<char>
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
#include <ios>
#include <iomanip>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRTV(v) sort(v.begin(),v.end())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;
typedef tuple<ll,ll,ll> Tl;

int atcoder(){
    //入力
    ll a,c;
  	string b
    cin >> a >> b >> c;
    
    if(b="+") cout << a+c << ENT;
    else cout << a-c << ENT;
    return 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Compiler output:
a.cc: In function 'int atcoder()':
a.cc:36:5: error: expected initializer before 'cin'
   36 |     cin >> a >> b >> c;
      |     ^~~
a.cc:38:8: error: 'b' was not declared in this scope
   38 |     if(b="+") cout << a+c << ENT;
      |        ^
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int A, B;
  cin >> A >> B;
  string op;
  
  if ( op == +) {
    cout << A+B << endl;
  }
  if ( op == - ) {
    cout << A-B << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
    9 |   if ( op == +) {
      |               ^
a.cc:12:16: error: expected primary-expression before ')' token
   12 |   if ( op == - ) {
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int A, B;
  cin >> A >> B;
  string op;
  
  if ( op == +) {
    cout << A op B << endl;
  }
  if ( op == - ) {
    cout << A op B << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
    9 |   if ( op == +) {
      |               ^
a.cc:10:14: error: expected ';' before 'op'
   10 |     cout << A op B << endl;
      |              ^~~
      |              ;
a.cc:12:16: error: expected primary-expression before ')' token
   12 |   if ( op == - ) {
      |                ^
a.cc:13:14: error: expected ';' before 'op'
   13 |     cout << A op B << endl;
      |              ^~~
      |              ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'op' was not declared in this scope
    8 |   if ( op == +) {
      |        ^~
a.cc:8:15: error: expected primary-expression before ')' token
    8 |   if ( op == +) {
      |               ^
a.cc:9:14: error: expected ';' before 'op'
    9 |     cout << A op B << endl;
      |              ^~~
      |              ;
a.cc:11:8: error: 'op' was not declared in this scope
   11 |   if ( op == - ) {
      |        ^~
a.cc:11:16: error: expected primary-expression before ')' token
   11 |   if ( op == - ) {
      |                ^
a.cc:12:14: error: expected ';' before 'op'
   12 |     cout << A op B << endl;
      |              ^~~
      |              ;
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 << endl;
  }else{
    cout << a-b << endl;
  }
}

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

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

Compiler output:
main.c: In function 'main':
main.c:6:4: error: expected expression before 'char'
    6 | if(char[0]=='+'){printf("%d\n",a+b);}
      |    ^~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char'
    4 | char c[1];
      | ^~~~
main.c:5:21: error: expected expression before '%' token
    5 | scanf("%d %c &d",&a,%c,&b);
      |                     ^
main.c:6:4: error: expected expression before 'char'
    6 | if(char[0]=='+'){printf("%d\n",a+b);}
      |    ^~~~
main.c:6:34: error: 'b' undeclared (first use in this function)
    6 | if(char[0]=='+'){printf("%d\n",a+b);}
      |                                  ^
main.c:6:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before 'else'
    7 | else
      | ^~~~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x,y;
    String str;
    x = sc.nextInt();
    str = sc.nextString();
    y = sc.nextInt();
    if(str == "+"){
      System.out.println(x+y);
    }
    else{
      System.out.println(x-y);
    }
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
    str = sc.nextString();
            ^
  symbol:   method nextString()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int x,y;
    char c;
    x = sc.nextInt();
    c = sc.nextChar();
    y = sc.nextInt();
    if(c == "+"){
      System.out.println(x+y);
    }
    else{
      System.out.println(x-y);
    }
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
    c = sc.nextChar();
          ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
Main.java:11: error: bad operand types for binary operator '=='
    if(c == "+"){
         ^
  first type:  char
  second type: String
2 errors
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;
  if(op=='-')
  cout << A-B;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected '}' at end of input
   11 |   cout << A-B;
      |               ^
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 s;
  	sin >> a >> s >> b;
  	if(s == '+')
      cout << a + b << endl;
  	else
      cout << a - b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>>'
    8 |         sin >> a >> s >> b;
      |         ~~~~^~~~
Language: C

#include<Stdio.h>

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

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

    if(op=='+'){
        printf("%d",a+b);
    }else{printf("%d",a-b);}
    return 0;
}

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

#include <stdio.h>
int main(){
int a,b;
char o[2];
  scanf("%d%c%d",&a,&o,%b);
  if(o=='+')
    printf("%d",a+b);
  else
    printf("%d",a-b);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:24: error: expected expression before '%' token
    5 |   scanf("%d%c%d",&a,&o,%b);
      |                        ^
main.c:6:7: warning: comparison between pointer and integer
    6 |   if(o=='+')
      |       ^~
Language: C

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

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

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

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

#include <stdio.h>

int a,b;
char op;

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

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define INF 1000000000
#define MOD 1000000007

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


Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 's' was not declared in this scope
   26 |     cout << s << endl;
      |             ^
Language: C++


#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	ll A,B;
	char op:
	cin>>A>>op>>B;
	if(op=='+'){
		ce(A+B)
	}else{
		ce(A-B)
	}
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: found ':' in nested-name-specifier, expected '::'
   41 |         char op:
      |                ^
      |                ::
a.cc:41:14: error: 'op' has not been declared
   41 |         char op:
      |              ^~
a.cc:42:12: error: qualified-id in declaration before '>>' token
   42 |         cin>>A>>op>>B;
      |            ^~
a.cc:43:12: error: 'op' was not declared in this scope
   43 |         if(op=='+'){
      |            ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |         str b;
      |         ^~~
      |         std
a.cc:6:17: error: 'b' was not declared in this scope
    6 |         cin>>a>>b>>c;
      |                 ^
Language: C++

astr, op, bstr = input().split()
a = int(astr)
b = int(bstr)
if op == '+':
	print(a + b)
elif op == '-':
	print(a - b)


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

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


int main(int argc, char const *argv[])
{
    int A;
    int B;
    char op;
    cin>>A>>op>>B;
    int C=A+B;
    int D=A-B;

    if (op=='+') {
        cout<<C
    }
    else
    {
        cout<<D;
    }
    
    

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:16: error: expected ';' before '}' token
   15 |         cout<<C
      |                ^
      |                ;
   16 |     }
      |     ~
Language: C++

#include "stdafx.h"
#include <iostream>
using namespace std;
int main(void)
{
	int a;
	int b;
	string c;


	cin >> a;
	cin >> c;
	if (c == "+") {

		cin >> b;
		cout << a + b << endl;
	}
	else {
		cin >> b;
		cout << a - b << endl;
	}

	return 0;
}


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

#include <iostream>
using namespace std;
int main(void)
{   
    int a;
    int b;
    string c;


    cin >> a;
    cin >> c;
    if(c=="+"){

        cin >> b;
        cout << a+b << endl;
    }else{
        cin >> b;
        cout << a-b << endl
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected ';' before '}' token
   18 |         cout << a-b << endl
      |                            ^
      |                            ;
   19 |     }
      |     ~
Language: C++

int main()
{
		int A, B;
		char OP;
		//文字入力
		scanf("%d", &A);
		scanf("%c", &OP);
		scanf("%d", &B);
		switch (OP) {
		case '+' :A+= B;break;
		case '-':A -= B; break;
		}
		printf("%d", A );


	

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'scanf' was not declared in this scope
    6 |                 scanf("%d", &A);
      |                 ^~~~~
a.cc:13:17: error: 'printf' was not declared in this scope
   13 |                 printf("%d", A );
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
Language: C

// 競技プログラミング.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
int main()
{
	while (true)
	{
		int A, B;
		char OP;
		//文字入力
		scanf("%d", &A);
		scanf("%c", &OP);
		scanf("%d", &B);
		switch (OP) {
		case '+' :A+= B;break;
		case '-':A -= B; break;
		}
		printf("%d", A );


	}


    return 0;
}



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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before 'cout'
    9 |   else (op=='-') cout << A - B << endl;
      |                 ^~~~~
      |                 ;
Language: C++

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

int main() {
  int a,b;
  string op;
  cin >> a >> op >> b;
  int ans;

  if (op == "+"){
  	ans = a + b;
  }

  if (op == "-"){
  	ans = a - b;
  }
  cout << ans << endl;
}z

Compiler output:
a.cc:18:2: error: 'z' does not name a type
   18 | }z
      |  ^
Language: C++

#include <iostream>
using namespace std;

int main(){
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:6:13: error: 'op' was not declared in this scope
    6 | cin >> a >> op >> b;
      |             ^~
Language: C++

#include <iostream>

using namespace std;

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

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

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

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

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

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

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

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

#include<iostream>
using namespace std;

int main(){
  int a,o,b;
  cin>>a>>o>>b;
  cout<<(o=="+"?a+b;a-b);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   cout<<(o=="+"?a+b;a-b);
      |          ~^~~~~
a.cc:7:20: error: expected ':' before ';' token
    7 |   cout<<(o=="+"?a+b;a-b);
      |                    ^
      |                    :
a.cc:7:20: error: expected primary-expression before ';' token
a.cc:7:20: error: expected ')' before ';' token
    7 |   cout<<(o=="+"?a+b;a-b);
      |         ~          ^
      |                    )
a.cc:7:24: error: expected ';' before ')' token
    7 |   cout<<(o=="+"?a+b;a-b);
      |                        ^
      |                        ;
Language: C++

#include <cstdio>
#include <iostream>

using namespace std;

int A, B;
char op;

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected '}' at end of input
   15 |         else cout << A - B;
      |                            ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <cstdo>
#include <iostream>
 
using namespace std;
 
int A, B;
char op;
 
int main(){
	cin >> A >> op >> B;
 
	if (op = '+') {
	cout << A + B;
	}
	else cout << A - B;
 
}

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


#include "pch.h"
#include <iostream>

using namespace std;

int A, B;
char op;

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

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

}


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

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

}

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

#include<iostream>
using namespace std;

int main(){
    int a,b
    string str;

    cin >> a >> str >> b;

    if(str[0] == '+'){
        cout << a + b << '\n';
    }
    else{
        cout << a - b << '\n';
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'string'
    6 |     string str;
      |     ^~~~~~
a.cc:8:17: error: 'str' was not declared in this scope; did you mean 'std'?
    8 |     cin >> a >> str >> b;
      |                 ^~~
      |                 std
a.cc:8:24: error: 'b' was not declared in this scope
    8 |     cin >> a >> str >> b;
      |                        ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,b;
  char op;
  cin >> a >> op >> b;
  cout << (c=='+'? a+b:a-b) << endl;
}

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

#include<bits/stdc++.h>
int main()
{
int a,b;
scanf("%d&d",&a,&b)
if(a>=1 b<=10)printf("%d",a+b)
else printf("no")
}

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

#include <iostreme>
using namespace std;

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

 return 0;
}

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

#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
  int a, b;
  char op;
  cin >> a >> op >> b;
  if (op == '+') {
    //    printf("%d\n", a+b);
    cout << a+b << "\n";
  }else {
    cout << a-b << "\n";
    //printf("%d\n", a-b);
  }
  return 0;
}
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
  int a, b;
  char op;
  cin >> a >> op >> b;
  if (op == '+') {
    //    printf("%d\n", a+b);
    cout << a+b << "\n";
  }else {
    cout << a-b << "\n";
    //printf("%d\n", a-b);
  }
  return 0;
}


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

#include<cstdio>

int main(){
	int A, B;
	char op;
	scanf("%d %c %d", &A,&op,&B);
	if(op == '+') printf("%d\n", A+B);
	if(op == '-') printf("%d\", A-B);

	return 0;
}

Compiler output:
a.cc:8:30: warning: missing terminating " character
    8 |         if(op == '-') printf("%d\", A-B);
      |                              ^
a.cc:8:30: error: missing terminating " character
    8 |         if(op == '-') printf("%d\", A-B);
      |                              ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: expected primary-expression before 'return'
   10 |         return 0;
      |         ^~~~~~
Language: C

#include<studio.h>
using namespace std;
map<int,int>q;
long long h,m;
char s;
int main()
{
    scanf("%lld %c %lld",&h,&s,&m);
    if(s=='+')
    {
        printf("%lld\n",h+m);
    }
    else
    {
         printf("%lld\n",h-m);
    }
    return 0;
}

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

#include<stdio.h>
int main()
{
	int A,B;
	char op;
	scanf("%d%c%d",&A,&op,&B);
	printf("%d\n",A op B);
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before 'op'
    7 |         printf("%d\n",A op B);
      |               ~        ^~~
      |                        )
Language: C++

#include<stdio.h>
int main(){
	int a,b;
	char op;
	scanf("%d%d",a,b);
	printf("%d\n",a op b);
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
    6 |         printf("%d\n",a op b);
      |               ~        ^~~
      |                        )
Language: C++

#include<stdio.h>
int main(){
	int a,b;
	char op;
	scanf("%d%%d",a,b);
	printf("%d\n",a op b);
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ')' before 'op'
    6 |         printf("%d\n",a op b);
      |               ~        ^~~
      |                        )
Language: C++

#include<stdio.h>
int main(){
	int a,b,op;
	scanf("%d%%d",a,b);
	printf("%d\n",a op b);
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected ')' before 'op'
    5 |         printf("%d\n",a op b);
      |               ~        ^~~
      |                        )
Language: Java

import java.util.Scanner;

public class findSecond
{

public static void main(String[] args)
{
	int A;
	int B;
	int C;
Scanner N = new Scanner(System.in);

A = N.nextInt();
B = N.nextInt();
C = A+B;

System.out.println( C);
{
	

}
}
}


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

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

Compiler output:
Main.java:7: error: cannot find symbol
str = sc.nextString();
^
  symbol:   variable str
  location: class Main
Main.java:7: error: cannot find symbol
str = sc.nextString();
        ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:9: error: cannot find symbol
if(str == "+") {
   ^
  symbol:   variable str
  location: class Main
Main.java:12: error: cannot find symbol
System.out.prinln(a - b);
          ^
  symbol:   method prinln(int)
  location: variable out of type PrintStream
4 errors
Language: Java

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

public class AddSubtract {
		// scanner to read
		final Scanner scan = new Scanner(System.in);
		// variables
		int A = scan.nextInt();
		int B = scan.nextInt();
		String op = scan.next();
		
		//the works baby
		if (op.equals("-")){
			System.out.println(A-B);
		}
		System.out.println(A+B);
}

Compiler output:
Main.java:13: error: illegal start of type
		if (op.equals("-")){
		^
Main.java:13: error: <identifier> expected
		if (op.equals("-")){
		             ^
Main.java:13: error: illegal start of type
		if (op.equals("-")){
		              ^
Main.java:16: error: <identifier> expected
		System.out.println(A+B);
		                  ^
Main.java:16: error: <identifier> expected
		System.out.println(A+B);
		                    ^
5 errors
Language: C++

#include<cstdio>
int main()
{
	int a,c;
	char b,n,m;
	int sum;
	while(scanf("%d",&a)!=EOF)
	{
		scanf("%c",&m);
		scanf("%c",&b);
		scanf("%c",&n);
		scanf("%d",&c);
		if(b==43)
		{
			sum=a+c;
			printf("%d\n",sum);
		}
		else
		{
			sum=a-c;
			printf("%d\n",sum);
		}

	}
	return  0;

Compiler output:
a.cc: In function 'int main()':
a.cc:25:19: error: expected '}' at end of input
   25 |         return  0;
      |                   ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: Java

import java.util.Scanner;

public class AddSubtract {
	
	public static void main(String[] args) {
		// scanner to read
		final Scanner scan = new Scanner(System.in);
		// variables
		int A = scan.nextInt();
		int B = scan.nextInt();
		String op = scan.next();
		
		//the works baby
		if (op.equals("-")){
			System.out.println(A-B);
		}
		System.out.println(A+B);
	}

}

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

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

public class AddSubtract {
	
	public static void main(String[] args) {
		// scanner to read
		final Scanner scan = new Scanner(System.in);
		// variables
		int A = scan.nextInt();
		int B = scan.nextInt();
		String op = scan.next();
		
		//the works baby
		if (op.equals("-")){
			System.out.println(A-B);
		}
		System.out.println(A+B);
	}

}

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

public class Main {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		int A;
		int B;
		String op;
		int output = 0;
		
		String input = sc.nextLine();
		A = Integer.parseInt(input.substring(0, 1));
		op = input.substring(1, 2);
		B = Integer.parseInt(input.substring(2, 3));
	
		if(op.equals("+"))
		{
			output = A + B;
		}
		else if(op.equals("-"))
		{
			output = A - B;
		}
		
		System.out.println(output);
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		int A;
		int B;
		String op;
		int output = 0;
		
		String input = sc.nextLine();
		A = Integer.parseInt(input.substring(0, 1));
		op = input.substring(1, 2);
		B = Integer.parseInt(input.substring(2, 3));
	
		if(op.equals("+"))
		{
			output = A + B;
		}
		else if(op.equals("-"))
		{
			output = A - B;
		}
		
		System.out.println(output);
	}


Compiler output:
Main.java:26: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.Scanner;

public class AddSubtract {
	
	public static void main(String[] args) {
		// scanner to read
		final Scanner scan = new Scanner(System.in);
		// variables
		int A = scan.nextInt();
		int B = scan.nextInt();
		String op = scan.next();
		
		//the works baby
		if (op.equals("-")){
			System.out.println(A-B);
		}
		System.out.println(A+B);
	}

}


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


import java.util.Scanner;

public class ADD
{

public static void main(String[] args)
{
	int A;
	int B;
	int C;
Scanner N = new Scanner(System.in);

A = N.nextInt();
B = N.nextInt();
C = A+B;

System.out.println( C);
{
	

}
}
}


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

import java.util.Scanner;

public class blah {
    public static void main() {
        Scanner input = new Scanner(System.in);
        String thing = input.nextLine();
        String [] thingies = thing.split(" ");
        int datThing = 0;

        if (thingies[1].equals("+")) {
            datThing = Integer.parseInt(thingies[0]) + Integer.parseInt(thingies[2]);
        }
        else {
            datThing = Integer.parseInt(thingies[0]) + Integer.parseInt(thingies[2]);
        }

       System.out.println(datThing);
    }
}


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

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

Compiler output:
Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
               ^
Main.java:1: error: <identifier> expected
import java.io.; import java.util.;
                                  ^
2 errors
Language: C++

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int a,b;
	char z;
	char c;
	char x;
	scanf("%d",&a);
	c = getchar();
	z = getchar();
	x = getchar();
	scanf("%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:25:25: error: expected '}' at end of input
   25 |         system("pause");
      |                         ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before ')' token
   15 |         if (c==-)
      |                 ^
a.cc:20:17: error: expected primary-expression before ')' token
   20 |         if (c==+)
      |                 ^
a.cc:25:25: error: expected '}' at end of input
   25 |         system("pause");
      |                         ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

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

public class main
{

	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 main is public, should be declared in a file named main.java
public class main
       ^
1 error