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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'C' was not declared in this scope
    7 |     if(C == '-')cout<<a-b<<"\n";
      |        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char**argv) {
  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(int, char**)':
a.cc:15:12: error: expected '}' at end of input
   15 |   return 0;
      |            ^
a.cc:5:32: note: to match this '{'
    5 | int main(int argc, char**argv) {
      |                                ^
Language: C++

#include <bits/stdc++.h>

int main(int argc, char**argv) {
  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(int, 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,
                 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:3: 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:16: 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)
      |     ^~~~
a.cc:13:12: error: expected '}' at end of input
   13 |   return 0;
      |            ^
a.cc:3:32: note: to match this '{'
    3 | int main(int argc, char**argv) {
      |                                ^
Language: C++

#include <bits/stdc++.h

int main(int, char**) {
  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:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
a.cc: In function 'int main(int, 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,
                 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:3: 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:16: 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)
      |     ^~~~
a.cc:13:12: error: expected '}' at end of input
   13 |   return 0;
      |            ^
a.cc:3:23: note: to match this '{'
    3 | int main(int, char**) {
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using rep(i, n)=for(int i = 0; i < n; i++);
using vi = vector<int>;

int main() {
	 int N;
    cin >> N;
    vi T(N);
    for (int i = 0; i < N; i++)
        cin >> T[i];
    int M;
    cin >> M;
    vi P(M);
    vi X(M);
    for (int i = 0; i < M; i++) {
        cin >> P[i];
        cin >> X[i];
    }

    int sum = 0;
    for (int i = 0; i < N; i++)
        sum = sum + T[i];


    for (int i = 0; i < M; i++)
        cout << sum - T[P.at(i)-1] + X[i] << endl;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'rep'
    4 | using rep(i, n)=for(int i = 0; i < n; i++);
      |       ^~~
a.cc:4:32: error: 'i' does not name a type
    4 | using rep(i, n)=for(int i = 0; i < n; i++);
      |                                ^
a.cc:4:39: error: 'i' does not name a type
    4 | using rep(i, n)=for(int i = 0; i < n; i++);
      |                                       ^
Language: Java

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

        if(op.charAt(0)=="+"){
            System.out.println(a+b);
        }else{
            System.out.println(a-b);
        }
    }
}


Compiler output:
Main.java:9: error: bad operand types for binary operator '=='
        if(op.charAt(0)=="+"){
                       ^
  first type:  char
  second type: String
1 error
Language: Java

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

        if(op.charAt(o)=="+"){
            System.out.println(a+b);
        }else{
            System.out.println(a-b);
        }
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        if(op.charAt(o)=="+"){
                     ^
  symbol:   variable o
  location: class Main
1 error
Language: Java

import java.util.*;

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

Compiler output:
Main.java:8: error: incompatible types: String cannot be converted to int
    	int b = sc.next();
    	               ^
1 error
Language: C++

A,op,C= input().split()

if op =="+":
    res = int(A)+int(C)

elif op =="-":
    res = int(A)-int(C)
    
print(res)

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

int Question50A(void) {
	int  inputA = 0;
	int inputB=0;
	char inputOp[2];
	int output = 0;
	scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
	if (inputOp[0] == '+') output = inputA + inputB;
	else  if (inputOp[0] == '-')  output = inputA - inputB;
	else return 0;
	printf("%d\n",output);
	return 0;
}

Compiler output:
main.c: In function 'Question50A':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int Question50A(void) {
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |         printf("%d\n",output);
      |         ^~~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int Question50A(void) {
	int  inputA = 0;
	int inputB=0;
	char inputOp[2];
	int output = 0;
	scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
	if (inputOp[0] == '+') output = inputA + inputB;
	else  if (inputOp[0] == '-')  output = inputA - inputB;
	else return 1;
	printf("%d\n",output);
	return 0;
}

Compiler output:
main.c: In function 'Question50A':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int Question50A(void) {
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d %s %d", &inputA, &inputOp[0], &inputB);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |         printf("%d\n",output);
      |         ^~~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
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;
  }
  
  if (op == "-")
    cout << a - b << endl;
}

}
  

Compiler output:
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:9: warning: missing terminating " character
    5 |   scanf("%d %d,&a,&b);
      |         ^
main.c:5:9: error: missing terminating " character
    5 |   scanf("%d %d,&a,&b);
      |         ^~~~~~~~~~~~~~
main.c:6:9: error: expected expression before 'if'
    6 |         if(a>=b){
      |         ^~
main.c:13:10: error: expected ';' before '}' token
   13 |         }
      |          ^
      |          ;
   14 |         }
      |         ~ 
main.c: At top level:
main.c:15:9: error: expected identifier or '(' before 'return'
   15 |         return 0;
      |         ^~~~~~
Language: C++

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

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

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

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


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<bits/stdc++.h>
using namespace std;
int main() {
  inta, b; char c; cin >> a >> c >> b;
  cout << a + (c == '+' ? b : -b) << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'op' was not declared in this scope
    7 |   if(op=='+'){
      |      ^~
a.cc:10:6: error: 'op' was not declared in this scope
   10 |   if(op=='-'){
      |      ^~
a.cc:13:6: error: 'op' was not declared in this scope
   13 |   if(op=="*"){
      |      ^~
a.cc:16:6: error: 'op' was not declared in this scope
   16 |   if(op=="/"){
      |      ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    7 |   int A=a,B=b;
      |         ^
      |         |
      |         std::string {aka std::__cxx11::basic_string<char>}
a.cc:7:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    7 |   int A=a,B=b;
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
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 if (op == "-") {
    cout << A - B << endl;
  }
}
 


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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'strint' was not declared in this scope; did you mean 'strcat'?
    5 |    strint op;
      |    ^~~~~~
      |    strcat
a.cc:7:4: error: expected initializer before 'cin'
    7 |    cin >> a >> op >> b;
      |    ^~~
a.cc:9:6: error: 'op' was not declared in this scope
    9 |   if(op == "+"){
      |      ^~
a.cc:10:16: error: 'b' was not declared in this scope
   10 |     cout<< a + b <<endl;
      |                ^
a.cc:13:16: error: 'b' was not declared in this scope
   13 |     cout<< a - b <<endl;
      |                ^
Language: C++

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

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

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

int main() {
  int A,B;
  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:6:15: error: 'op' was not declared in this scope
    6 |   cin >> A >> op >> B;
      |               ^~
a.cc:7:14: error: expected primary-expression before ')' token
    7 |   if (op == +) cout << A + B <<endl;
      |              ^
a.cc:8:14: error: expected primary-expression before ')' token
    8 |   if (op == -) cout << A - B <<endl;
      |              ^
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;
  if (op=="-")
    cout<<A-B<<endl;
}


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

import java.util.Scanner;
public class Answer {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);//Scanner型の変数sにインスタンス化したメソッドを代入
		int A = s.nextInt();
		int B = s.nextInt();
		String op = s.next();
		
		System.out.println(op.equals("+") ? A + B : A - B);
		s.close();
	}

}

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

import java.util.Scanner;
public class Answer {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);//Scanner型の変数sにインスタンス化したメソッドを代入
		int A = s.nextInt();
		int B = s.nextInt();
		boolean op = true;
		
		if (op) {
			System.out.println(A + B);
		} else {
			System.out.println(A - B);
		}
		s.close();
		

	}

}



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

#include<bits/stdc++.h>
using namespace std;
int a,b;		
string op;	
cin>>a>>op>>b;		

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


Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin>>a>>op>>b;
      | ^~~
Language: C++

#include <iostream>
#include<string.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:2: error: 'string' was not declared in this scope
    5 |  string op;
      |  ^~~~~~
a.cc:5:2: 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:6:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |  cin>>A>>op>>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:6:10: error: 'op' was not declared in this scope
    6 |  cin>>A>>op>>B;
      |          ^~
a.cc:9:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |    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:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |    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)
      |     ^~~~
a.cc:13:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |    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:13:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |    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.h>
#include<string.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:1:10: fatal error: iostream.h: No such file or directory
    1 | #include <iostream.h>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include<string.h>
int main()
{ int A,B;
 string op;
 if(op=="+")
 {
   cout<<A+B<<endl;
 }
 else
 {
   cout<<A-B<<endl;
 }
}
   


Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
    5 |  string op;
      |  ^~~~~~
a.cc:5:2: 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:6:5: error: 'op' was not declared in this scope
    6 |  if(op=="+")
      |     ^~
a.cc:8:4: 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:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |    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)
      |     ^~~~
a.cc:12:4: 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:15: 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 <iostream>
#include <bits/stdc++.h>
int main()
{ int A,B;
 string op;
 if(op=="+")
 {
   cout<<a+b<<endl;
 }
 else
 {
   cout<<a-b<<endl;
 }
}
   


Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
    5 |  string op;
      |  ^~~~~~
a.cc:5:2: 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:6:5: error: 'op' was not declared in this scope
    6 |  if(op=="+")
      |     ^~
a.cc:8:4: 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:10: error: 'a' was not declared in this scope
    8 |    cout<<a+b<<endl;
      |          ^
a.cc:8:12: error: 'b' was not declared in this scope
    8 |    cout<<a+b<<endl;
      |            ^
a.cc:8:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |    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)
      |     ^~~~
a.cc:12:4: 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:10: error: 'a' was not declared in this scope
   12 |    cout<<a-b<<endl;
      |          ^
a.cc:12:12: error: 'b' was not declared in this scope
   12 |    cout<<a-b<<endl;
      |            ^
a.cc:12:15: 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 <iostream>
#include <bits/stdc++.h>
int main()
{ int A,B;
 string op;
 if(op==+)
 {
   cout<<a+b<<endl;
 }
 else
 {
   cout<<a-b<<endl;
 }
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
    5 |  string op;
      |  ^~~~~~
a.cc:5:2: 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:6:5: error: 'op' was not declared in this scope
    6 |  if(op==+)
      |     ^~
a.cc:6:10: error: expected primary-expression before ')' token
    6 |  if(op==+)
      |          ^
a.cc:8:4: 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:10: error: 'a' was not declared in this scope
    8 |    cout<<a+b<<endl;
      |          ^
a.cc:8:12: error: 'b' was not declared in this scope
    8 |    cout<<a+b<<endl;
      |            ^
a.cc:8:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |    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)
      |     ^~~~
a.cc:12:4: 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:10: error: 'a' was not declared in this scope
   12 |    cout<<a-b<<endl;
      |          ^
a.cc:12:12: error: 'b' was not declared in this scope
   12 |    cout<<a-b<<endl;
      |            ^
a.cc:12:15: 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++

using namespace std;

int main() {
 int a, b;
cout << (a + b) << endl;
cout << (a - b) << endl;
}

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

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

int main() {
  int A;
  char op;
  int B;
  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,B;
  char op;
  cin >> A >> op >> B;
  //演算部
  if (op == "+") cout << A + B << endl;
  else if (op == "-") cout << A - B << endl;
}

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

#include <bits/stdc++.h>

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

Compiler output:
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>>ch>>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:10:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |      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:13:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |      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 <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <set>
#include <iomanip>
#include <stdio.h>
#include <sstream>
#include <string>
using namespace std;
int main(void){
  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:17:15: error: expected primary-expression before '<<' token
   17 |     cout<<a+b;<<endl;
      |               ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

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

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

int main() {
  string 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:10:18: error: expected primary-expression before ',' token
   10 |   else cout<<a-c<,endl;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < (int)(n); i++ )
#define ll long long int

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

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < (int)(n); i++ )
#define ll long long int

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before 'A'
   10 |     cin A >> op >> B;
      |        ^~
      |        ;
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if ( op == "+" )
      |          ~~~^~~~~~
a.cc:17:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     else if ( op == "-" )
      |               ~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int a,b;
  char s;
  if(s=='+') cout<<a+b;
  else cout<<a-b;


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

#include<iostrem>
using namespace std;

int main()
{
  int a,b;
  char s;
  if(s=='+') cout<<a+b;
  else cout<<a-b;

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

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


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

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


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

#include <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:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include <stdc++.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> a >> op >> b;
      |   ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << a << endl;
      |   ^~~~
a.cc:15:16: error: 'endl' was not declared in this scope
   15 |   cout << a << 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;
  }
  if(op=="-"){
    cout<<A-B<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'cin'
    7 |     cin >> A >> op >> B ;
      |     ^~~
a.cc:8:6: error: 'op' was not declared in this scope
    8 |   if(op == "+"){
      |      ^~
a.cc:11:6: error: 'op' was not declared in this scope
   11 |   if(op=="-"){
      |      ^~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int a, b, op;
	op = + or -;
	cout << a op b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected primary-expression before 'or' token
    7 |         op = + or -;
      |                ^~
a.cc:7:20: error: expected primary-expression before ';' token
    7 |         op = + or -;
      |                    ^
a.cc:8:18: error: expected ';' before 'op'
    8 |         cout << a op b;
      |                  ^~~
      |                  ;
Language: C++

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc: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,op,B;
  cin >> A >> op >> B;

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


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

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: 'long long long' is too long for GCC
    4 | long long long int a,b;
      |           ^~~~
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin<<a<<c<<b;
      | ^~~
a.cc:8:1: error: 'cout' was not declared in this scope
    8 | cout>>a+b;
      | ^~~~
a.cc:10:1: error: 'cout' was not declared in this scope
   10 | cout>>a+b;
      | ^~~~
Language: C

void add
{ 
    int a,b,c,d,ch;
    printf("enter the value for a");
    scanf("%d",&a);
    printf("enter the value for b");
   scanf("%d",&b);
   printf("enter your choice:\n 1->add\n2-->subtract\n");
   scanf("%d",&ch);
  switch(ch)
{
 case 1:
    c=a+b;
   printf("%d",c);
  break;
case 2:
   d=a-b;
  printf("%d",d);
 break;
}
}
   

Compiler output:
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | {
      | ^
Language: C++

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

int main()
{
	int a,b;
	cin>>a;
	char ch;
	cin>>op;
	cin>>b;
	int res=ch=='-'?a-b:a+b;
	cout<<res<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: 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;
  char op;
  int ans;
  cin >> A >> op >> B;
  if(op=="+"){
    ans = A+B;
  } else {
    ans = A-B;
  }
}	


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

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

int main(){
  int A,B;
  char op;
  int ans;
  cin >> A >> op >> B;
  if(op=="+"){
    ans = A+B;
  } else {
    ans = A-B
  }
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(op=="+"){
      |      ~~^~~~~
a.cc:12:14: error: expected ';' before '}' token
   12 |     ans = A-B
      |              ^
      |              ;
   13 |   }
      |   ~
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:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
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;
  string op;
  if(op=="+"){
    cout<<A+B<< endl;
  }
  else{
    cout<<A-B<< endl;
  }

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

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

int main(){
    int m, n;
    char x;
    cin >> m >> x >> n;
    if(x == '+'){
        cout << m + n << '\n';
    }
    if(x == '-'){
        cout << m - n << '\n'
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before '}' token
   12 |         cout << m - n << '\n'
      |                              ^
      |                              ;
   13 |     }
      |     ~
Language: C++

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

int main() {
   int A , B;
   string op;
   cin >> A >> B >> 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:9:14: error: expected ';' before 'op'
    9 |     cout << A op B << endl;
      |              ^~~
      |              ;
a.cc:13:14: error: expected ';' before 'op'
   13 |     cout << A op B << endl;
      |              ^~~
      |              ;
Language: C++

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

int maina(){
    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 maina()':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <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:7:7: error: expected initializer before '>>' token
    7 |   cin >> A >> op >> B;
      |       ^~
a.cc:12:26: error: expected ';' before '}' token
   12 |     cout << A - B << endl
      |                          ^
      |                          ;
   13 |   }
      |   ~
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:7:14: error: conflicting types for 'c'; have 'char'
    7 |         char c;
      |              ^
main.c:6:24: note: previous declaration of 'c' with type 'long long int'
    6 |         long long a, b,c;
      |                        ^
Language: C

#include<stdio.h>
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:
main.c: In function 'main':
main.c:6:9: error: 'cin' undeclared (first use in this function)
    6 |         cin>>a>>op>>b;
      |         ^~~
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:17: error: 'cout' undeclared (first use in this function)
    8 |                 cout<<a+b<<endl;
      |                 ^~~~
main.c:8:28: error: 'endl' undeclared (first use in this function)
    8 |                 cout<<a+b<<endl;
      |                            ^~~~
Language: C++

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


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

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: could not convert 'x.std::__cxx11::basic_string<char>::operator=(((const char*)"+"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(x="+"){
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:14: error: expected ';' before '}' token
    9 |     c = a + b
      |              ^
      |              ;
   10 |   }else if(x="-"){
      |   ~           
a.cc:10:13: error: could not convert 'x.std::__cxx11::basic_string<char>::operator=(((const char*)"-"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   10 |   }else if(x="-"){
      |            ~^~~~
      |             |
      |             std::__cxx11::basic_string<char>
a.cc:11:13: error: expected ';' before '}' token
   11 |     c= a - b
      |             ^
      |             ;
   12 |   }
      |   ~