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

// 2019/07/08
// AtCoder Beginner Contest 050 - A

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // Input
        int a = sc.nextInt();
        int o = sc.next();
        int b = sc.nextInt();
        int ans;

        // Check
       if(o.equals("+")){
           ans = a + b;
       } else {
           ans = a - b;
       }
       
       // Output
       System.out.println(ans);
    }
}

Compiler output:
Main.java:10: error: incompatible types: String cannot be converted to int
        int o = sc.next();
                       ^
Main.java:15: error: int cannot be dereferenced
       if(o.equals("+")){
           ^
2 errors
Language: C++

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

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

#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<queue>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main() {
  ll 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:20:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |   if (op == "+") cout << A+B << endl;
      |       ~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;

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

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

#include <bits/stdc++.h>
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:5:3: error: 'string' was not declared in this scope
    5 |   string op;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 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:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> A >> op >> B;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:15: error: 'op' was not declared in this scope
    6 |   cin >> A >> op >> B;
      |               ^~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     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:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |     cout << A+B << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |     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:11:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |     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() {
  int A,B,X;
  char OP;
  cin >> A >> OP >> B;

if(OP=="+"){
X = A + B;
}
if(OP=="-"){
X = A- B;
}

cout << X <<endl; 

}


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

#include <bits/stdc++.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>a>>op>>b;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |         cout<<a<<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:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         cout<<a<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

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

  cin >> a >> op >> b;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> a >> op >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if( op=='+' ) 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:9:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   if( op=='+' ) 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:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   if( op=='-' ) 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:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   if( op=='-' ) 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 <iostream>
 
using namespace std;
 
int main(void) {
  (double)int A, B;
  string op;
  
  if (A < B) {
    if (op == "+") {
      cout << A+B << endl;
    } else {
      cout << "-" << B-A << endl;
  } else {
    if (op == "+") {
      cout << A+B << endl;
    } else {
      cout << A-B << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before 'int'
    6 |   (double)int A, B;
      |           ^~~
a.cc:9:7: error: 'A' was not declared in this scope
    9 |   if (A < B) {
      |       ^
a.cc:9:11: error: 'B' was not declared in this scope
    9 |   if (A < B) {
      |           ^
a.cc:14:5: error: expected '}' before 'else'
   14 |   } else {
      |     ^~~~
a.cc:9:14: note: to match this '{'
    9 |   if (A < B) {
      |              ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:14:10: note: to match this '{'
   14 |   } else {
      |          ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:16: note: to match this '{'
    5 | int main(void) {
      |                ^
Language: C++

#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int(double) A, B;
      |   ^~~
a.cc:9:7: error: 'A' was not declared in this scope
    9 |   if (A < B) {
      |       ^
a.cc:9:11: error: 'B' was not declared in this scope
    9 |   if (A < B) {
      |           ^
a.cc:14:5: error: expected '}' before 'else'
   14 |   } else {
      |     ^~~~
a.cc:9:14: note: to match this '{'
    9 |   if (A < B) {
      |              ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:14:10: note: to match this '{'
   14 |   } else {
      |          ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:16: note: to match this '{'
    5 | int main(void) {
      |                ^
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;
  }
}

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

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

int main () {
  int A, B;
  char op;
  cin >> A >> op >> B;
  
  cout << A op B << endl;
}

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

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

int main () {
  int A, B;
  string op;
  
  cout << A op B << endl;
}

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

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
 int a,c;
 char b;
cin >> a >> b >> c;
if(b=="+"){
cout << a + c;
}else{
    cout << a - c;
}
}

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

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
 int a,c;
 char b;
cin >> a >> b >> c;
if(b=="+"){
cout << a + c;
}
cout << "vowel"; 
}else{
    cout << a - c;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if(b=="+"){
      |    ~^~~~~
a.cc: At global scope:
a.cc:16:2: error: expected unqualified-id before 'else'
   16 | }else{
      |  ^~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <cfloat>
using namespace std;
int main (){
char a,b,c;
cin >> c;
if(b=="+"){
cout << a + c;
}
cout << "vowel"; 
}else{
    cout << a - c;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if(b=="+"){
      |    ~^~~~~
a.cc: At global scope:
a.cc:15:2: error: expected unqualified-id before 'else'
   15 | }else{
      |  ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

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

  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before 'op'
   11 |      cout << A op B <<endl;
      |               ^~~
      |               ;
a.cc:15:12: error: expected ';' before 'op'
   15 |   cout << A op B << endl;
      |            ^~~
      |            ;
Language: C++

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

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

  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'char'
    6 |   char op
      |   ^~~~
a.cc:9:9: error: 'A' was not declared in this scope
    9 |  cin >> A >> B ;
      |         ^
a.cc:9:14: error: 'B' was not declared in this scope
    9 |  cin >> A >> B ;
      |              ^
a.cc:10:10: error: 'op' was not declared in this scope
   10 |   cin >> op ;
      |          ^~
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:9:15: error: expected primary-expression before ')' token
    9 |    if (op == +){
      |               ^
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 << endl;
  }      
}

  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before ')' token
    9 |    if (op == +){
      |               ^
a.cc:11:4: error: expected primary-expression before '}' token
   11 |    }
      |    ^
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:10:12: error: expected ';' before 'op'
   10 |   cout << A op B << endl;
      |            ^~~
      |            ;
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'op'
    9 |   cout << A op B << endl;
      |            ^~~
      |            ;
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
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;
  else cout << a-b;
}

Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
......
    6 | int main(){
      | ~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'c' was not declared in this scope
   10 |                 c=a+b;
      |                 ^
a.cc:13:17: error: 'c' was not declared in this scope
   13 |                 c=a-b;
      |                 ^
a.cc:15:24: error: 'c' was not declared in this scope
   15 |         printf("%d\n",&c);
      |                        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'c' was not declared in this scope
   10 |                 c=a+b;
      |                 ^
a.cc:13:17: error: 'c' was not declared in this scope
   13 |                 c=a-b;
      |                 ^
a.cc:15:22: error: 'c' was not declared in this scope
   15 |         printf("%d",&c);
      |                      ^
Language: C++

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

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

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll a;
  	ci(a);
  ch b;
  	ci(b);
  ll c;
  	ci(c);
  if(b=='+') co(a+b);
  else co(a-b)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:3: error: 'else' without a previous 'if'
   83 |   else co(a-b)
      |   ^~~~
Language: C++

main = do
  n <- words <$> getLine
  let l = read $ head n
  let op = head $ tail n
  let r = read $ last n
  putStrLn $ biop op l r
  
biop :: String -> Int -> Int -> String
biop o l r
  | o == "+" = show $ l + r
  | o == "-" = show $ subtract r l
  | otherwise = undefined

Compiler output:
a.cc:1:1: error: 'main' does not name a type
    1 | main = do
      | ^~~~
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;
}

Compiler output:
a.cc: In function 'int main()':
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<iostream>
#include<string>
int main(){
  int a,b;string s;cin>>a>>s>>b;
  if(s=='+')cout<<a+b;
  else cout<<a-b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: 'string' was not declared in this scope
    4 |   int a,b;string s;cin>>a>>s>>b;
      |           ^~~~~~
a.cc:4:11: 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:4:20: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   int a,b;string s;cin>>a>>s>>b;
      |                    ^~~
      |                    std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:28: error: 's' was not declared in this scope
    4 |   int a,b;string s;cin>>a>>s>>b;
      |                            ^
a.cc:5:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   if(s=='+')cout<<a+b;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   else cout<<a-b;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <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:7:15: error: could not convert 'op.std::__cxx11::basic_string<char>::operator=(43)' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |         if(op = '+'){
      |            ~~~^~~~~
      |               |
      |               std::__cxx11::basic_string<char>
Language: C++

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

Compiler output:
a.cc:10:19: warning: multi-character character constant [-Wmultichar]
   10 |         cout << A 'op' B << endl;
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '\x6f70'
   10 |         cout << A 'op' B << endl;
      |                  ^~~~~
      |                  ;
Language: C++

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

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

#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
	int a,b;
  	char c;
	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:14:21: error: 'op' was not declared in this scope
   14 |         cin >> a >> op >> b;
      |                     ^~
Language: C++

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

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

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

    unsigned long long int a[999999][999999],i,j,k,l,n,m,x,y;
int main()
{
      a[1][1]=1;
    for(i=1; i<=999999; i++)
    {
        if(i%2==0)
        {
            a[i][1]=((i-1)*(i-1))+(j-1);
            for(j=2; j<=i; j++)
            {
                a[i][j]=a[i][1]+1;
            }
        }
        else if(i%2==1)
        {
            a[i][1]=(i*i);
            for(j=2; j<=i; j++)
            {
                a[i][j]=a[i][1]-(j-1);
            }
        }

    }



   for(i=1; i<=999999; i++)
    {
        if(i%2==0)
        {
            a[1][i]=(i*i);
            for(j=2; j<=i; j++)
            {
                a[j][i]=a[1][i]-(j-1);
            }
        }
        else if(i%2==1)
        {
            a[1][i]=((i-1)*(i-1))+1;
            for(j=2; j<=i; j++)
            {
                a[j][i]=a[1][i]+(j-1);
            }
        }

    }
scanf("%llu",&n);
for(m=1;m<=n;m++)
{

scanf("%llu",&x);
for(k=1;k<=999999;k++)
    {
        for(l=1;l<=999999;l++)
        {
            if(a[k][l]==x){ printf("Case %llu: %llu %llu\n",m,l,k);break;}
        }
        if(a[k][l]==x){break;}
    }
}

    return 0;
}


Compiler output:
/tmp/ccPaKZRY.o: in function `main':
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x59): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x83): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0x9c): relocation truncated to fit: R_X86_64_PC32 against symbol `i' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0xa3): relocation truncated to fit: R_X86_64_PC32 against symbol `j' defined in .bss section in /tmp/ccPaKZRY.o
main.c:(.text+0xcb): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{   using namespace std;
    long long int i,j,k,d,m,res,rem,sum=0,su=0,r,p;
    char a[10000],b[10000];
    while(gets(a))
    {
        for(i=0; a[i]!=' '; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                d = i;
            }
        }
        for(i=d+4; a[i]!='\0'; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                m = i;
            }
        }
        p = m-(d+4);
        rem = pow(10,d);
        if(d==2 || d==4 || d==7 || d==8 || d==9) {rem = rem+1;}
        res = pow(10,p);
        if(p==2 || p==4 || p==7 || p==8 || p==9) {res = res+1;}
        for(i=0; i<=d; i++)
        {
            sum = sum + (b[i]*rem);
            rem = rem/10;
        }
        for(i=d+4; i<=m; i++)
        {
            su = su + (b[i]*res);
            res = res/10;
        }
        if(a[d+2]=='+') {r=sum+su;}
        else if(a[d+2]=='-') {r=sum-su;}
        printf("%lld\n",r);
        su = 0;
        sum = 0;
        r = 0;
        res = 0;
        rem = 0;
        d = 0;
        m = 0;
        p = 0;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |     while(gets(a))
      |           ^~~~
      |           getw
Language: C++

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    long long int i,j,k,d,m,res,rem,sum=0,su=0,r,p;
    char a[10000],b[10000];
    while(gets(a))
    {
        for(i=0; a[i]!=' '; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                d = i;
            }
        }
        for(i=d+4; a[i]!='\0'; i++)
        {
            if(a[i]<='9' && a[i]>='0')
            {
                b[i] = a[i] - 48;
                m = i;
            }
        }
        p = m-(d+4);
        rem = pow(10,d);
        if(d==2 || d==4 || d==7 || d==8 || d==9) {rem = rem+1;}
        res = pow(10,p);
        if(p==2 || p==4 || p==7 || p==8 || p==9) {res = res+1;}
        for(i=0; i<=d; i++)
        {
            sum = sum + (b[i]*rem);
            rem = rem/10;
        }
        for(i=d+4; i<=m; i++)
        {
            su = su + (b[i]*res);
            res = res/10;
        }
        if(a[d+2]=='+') {r=sum+su;}
        else if(a[d+2]=='-') {r=sum-su;}
        printf("%lld\n",r);
        su = 0;
        sum = 0;
        r = 0;
        res = 0;
        rem = 0;
        d = 0;
        m = 0;
        p = 0;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     while(gets(a))
      |           ^~~~
      |           getw
Language: Java

import java.util.*;
public class shimu{
    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.equals("+")){
            System.out.println(A+B);
        }
        else{
            System.out.println(A-B);
        }
        sc.close();
    }
}

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

#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>

using namespace std;

int main(int argc, char* argv[])
{

	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(int, char**)':
a.cc:13:9: error: expected initializer before 'char'
   13 |         char op;
      |         ^~~~
a.cc:15:21: error: 'op' was not declared in this scope
   15 |         cin >> A >> op >> B;
      |                     ^~
a.cc:15:27: error: 'B' was not declared in this scope
   15 |         cin >> A >> op >> B;
      |                           ^
Language: C++

#include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected initializer before 'op'
   10 |     string op;
      |            ^~
a.cc:11:17: error: 'op' was not declared in this scope
   11 |     cin >> a >> op >> b;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected initializer before 'op'
   10 |     string op;
      |            ^~
a.cc:11:17: error: 'op' was not declared in this scope
   11 |     cin >> a >> op >> b;
      |                 ^~
Language: C++

read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c]

Compiler output:
a.cc:1:1: error: 'read' does not name a type
    1 | read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c]
      | ^~~~
a.cc:1:13: error: expected unqualified-id before '[' token
    1 | read a b c; [ $b = '+' ] && echo $[a+c] || echo $[a-c]
      |             ^
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:12:23: error: expected '}' at end of input
   12 |   cout << a-b << endl;
      |                       ^
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 op;
    cin >> a >> op >> b;
    cout << (op=='+' ? a+b : a-b) endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected ';' before 'endl'
    8 |     cout << (op=='+' ? a+b : a-b) endl;
      |                                  ^~~~~
      |                                  ;
Language: C++

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

using namespace std;



int main() {


	int a, b;
	char op;

	cin >> a;
	getchar();
	cin >> op;
	getchar();
	cin >> b;

	if (op == '+')a += b;
	else a -= b;

	cout << a << endl;

	system("pause");
	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>
#include<string>
using namespace std;
int main(void){
  int a, c;
  string 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:8: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(b = "+") cout << a + c <<endl;
      |      ~~^~~~~
      |        |
      |        std::__cxx11::basic_string<char>
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;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin >> a >> c >> b;
      |   ^~~
a.cc:8:7: error: 'c' was not declared in this scope
    8 |   if (c=='+') cout << a+b << endl;
      |       ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc:8:19: warning: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^
a.cc:8:19: error: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
    8 |         if(op=='+''){
      |                   ^
      |                   ;
    9 |                 cout << a+b;
      |                 ~~~~
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }
      |         ^
a.cc:9:29: error: expected ')' before '}' token
    9 |                 cout << a+b;
      |                             ^
      |                             )
   10 |         }
      |         ~                    
a.cc:8:11: note: to match this '('
    8 |         if(op=='+''){
      |           ^
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }
      |         ^
a.cc: At global scope:
a.cc:11:9: error: expected unqualified-id before 'if'
   11 |         if(op=='-'){
      |         ^~
a.cc:15:9: error: expected unqualified-id before 'return'
   15 |         return 0;
      |         ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a;
	int 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:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc:8:19: warning: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^
a.cc:8:19: error: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
    8 |         if(op=='+''){
      |                   ^
      |                   ;
    9 |                 cout << a+b;
      |                 ~~~~
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }else if(op=='-'){
      |         ^
a.cc:9:29: error: expected ')' before '}' token
    9 |                 cout << a+b;
      |                             ^
      |                             )
   10 |         }else if(op=='-'){
      |         ~                    
a.cc:8:11: note: to match this '('
    8 |         if(op=='+''){
      |           ^
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }else if(op=='-'){
      |         ^
a.cc: At global scope:
a.cc:10:10: error: expected unqualified-id before 'else'
   10 |         }else if(op=='-'){
      |          ^~~~
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0;
      |         ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main() {
	int a;
	int b;
	char op;
	
	cin >> a >> op >> b
	if(op=='+'){
		cout << a+b;
	}
	if(op=='-'){
		cout << a-b;
	}
	return 0;
}

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

#include <iostream>
using namespace std;

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

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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc:8:19: warning: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^
a.cc:8:19: error: missing terminating ' character
    8 |         if(op=='+''){
      |                   ^~~
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'cout'
    8 |         if(op=='+''){
      |                   ^
      |                   ;
    9 |                 cout<< a+b;
      |                 ~~~~
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }else if(op=='-'){
      |         ^
a.cc:9:28: error: expected ')' before '}' token
    9 |                 cout<< a+b;
      |                            ^
      |                            )
   10 |         }else if(op=='-'){
      |         ~                   
a.cc:8:11: note: to match this '('
    8 |         if(op=='+''){
      |           ^
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }else if(op=='-'){
      |         ^
a.cc: At global scope:
a.cc:10:10: error: expected unqualified-id before 'else'
   10 |         }else if(op=='-'){
      |          ^~~~
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0;
      |         ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

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

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

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

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

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

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

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

int main() {
  int x, y;
  stirng op;
  cin >> x >> op >> y;

  if (op == "+") {
    cout << x + y << endl;
  }
  else {
    cout << x - y << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng op;
      |   ^~~~~~
a.cc:7:15: error: 'op' was not declared in this scope
    7 |   cin >> x >> op >> y;
      |               ^~
Language: C++

#include <iostream>
#include <cstdio>
#include <string.h>
#include <stdio.h>

using namespace std;
int main(){
    int a;
    int b;
    int c;
    char n1;
    char e;
    
    scanf("%d", &a);
    scanf("%c", &n1);
    scanf("%c", &e);
    scanf("%d", &b);
    if('+' == e){
        c = (a + b);
    };
    if('-' == e){
        c = (a - b);
    };
    printf("%d\n", c);

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected '}' at end of input
   24 |     printf("%d\n", c);
      |                       ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

int main(){
int a;
int b;
int c;
scanf("%d", &a);
scanf("%d", &b);
c = (a + b);
printf("%d\", c);
return 0;

}


Compiler output:
a.cc:12:8: warning: missing terminating " character
   12 | printf("%d\", c);
      |        ^
a.cc:12:8: error: missing terminating " character
   12 | printf("%d\", c);
      |        ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:1: error: expected primary-expression before 'return'
   13 | return 0;
      | ^~~~~~
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;
  }else{
    cout<<a-b;
  }
  return 0;
}


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

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

int main(){
  string A,B;
  char op;
  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:11:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |     a=atoi(A);
      |            ^
      |            |
      |            std::string {aka std::__cxx11::basic_string<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:12:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |     b=atoi(B);
      |            ^
      |            |
      |            std::string {aka std::__cxx11::basic_string<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: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   16 |     a=atoi(A);
      |            ^
      |            |
      |            std::string {aka std::__cxx11::basic_string<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:17:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   17 |     b=atoi(B);
      |            ^
      |            |
      |            std::string {aka std::__cxx11::basic_string<char>}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~