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

#include<iostream>
using namespace std;

int main(){
int x,y;char c;
cin>>x>>c>>y;
if(c=="+"){cout<<x+y<<endl;}else{cout<<x-y<<endl;}
return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[1000];
    int p=0,b=0,sum=0,f=0,i;
    gets(a);
    int len=strlen(a);
    for(i=0;i<len;i++)
    {
        if(a[i]!=' '&&a[i]!='+'&&a[i]!='-')
        {
            sum=sum+a[i]-48;
            sum=sum*10;
           // cout<<sum<<endl;
        }
        else if(a[i]=='+')
        {
            p=sum;
            sum=0;
            f=1;
        }
        else if(a[i]=='-')
        {
            p=sum;
            sum=0;
            f=2;
        }
    }
    p=p/10;
    sum=sum/10;
    if(f==1)cout<<p+sum<<endl;
    else
    cout<<p-sum<<endl;
    return 0;

}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char d[100];
    char *a,b[10];

    int p,q;
    gets(d);
    a=strtok(d," ");
    p=atoi(a);
    for(int i=0;a!=NULL;i++)
    {
        if(i==1)strcpy(b,a);
        if(i==2)q=atoi(a);
        a=strtok(NULL," ");
    }
     if(strcmp(b,"+")==0)cout<<p+q<<endl;
     else cout<<p-q<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(d);
      |     ^~~~
      |     getw
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:6:15: error: expected ')' before ';' token
    6 |  cin>>a>>op>>b;
      |               ^
      |               )
a.cc:5:9: note: to match this '('
    5 |  char op(
      |         ^
Language: C++

s = input().split()
a, b = int(s[0]), int(s[2]);
if s[1]== '+':
    a+=b;
    print (a)
else:
    a-=b;
    print (a)


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input().split()
      | ^
a.cc:3:1: error: expected unqualified-id before 'if'
    3 | if s[1]== '+':
      | ^~
a.cc:5:11: error: expected constructor, destructor, or type conversion before '(' token
    5 |     print (a)
      |           ^
a.cc:8:11: error: expected constructor, destructor, or type conversion before '(' token
    8 |     print (a)
      |           ^
Language: Java

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

Compiler output:
Main.java:3: error: cannot find symbol
	Scanner scan = new Scanner(System.in);
	^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	Scanner scan = new Scanner(System.in);
	                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

static void Main(string[] args)
        {
            try
            {
                uint a = uint.Parse(args[0]);
                var op = args[1];
                int b = int.Parse(args[2]);

                if (op == "+") System.Console.Out.WriteLine(a + b);
                else if (op == "-") System.Console.Out.WriteLine(a - b);
            }catch(Exception e) { e.GetBaseException(); }
        }

Compiler output:
a.cc:1:13: error: variable or field 'Main' declared void
    1 | static void Main(string[] args)
      |             ^~~~
a.cc:1:18: error: 'string' was not declared in this scope
    1 | static void Main(string[] args)
      |                  ^~~~~~
a.cc:1:25: error: expected primary-expression before ']' token
    1 | static void Main(string[] args)
      |                         ^
Language: C++

#include <stdio>

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

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

#include <iostream>
#include <vector>
using namespace std;
int Gets(char *buff,int buffMaxSize)
{
	buff[0]='\0';
	if (fgets(buff,buffMaxSize,stdin)==NULL){
		return -1;
	}
	size_t strLen = strlen(buff);
	if (strLen>0){
		while (buff[strLen-1] == '\r' || buff[strLen-1]=='\n'){//改行コード
			strLen--;
			buff[strLen]='\0';
		}
	}
	return (int)strLen;
}
int GetData(vector<string> &dataList,char *line,char *deli)
{
	char *p = new char[strlen(line)+1];
	strcpy(p,line);
	char* token = strtok(p, deli);
	while (token != NULL) {
		dataList.push_back(token);
		token = strtok(NULL, deli);
	}
	delete[] p;
	return 0;
}
int main(int argc, char* argv[])
{
	char s[1024];
	Gets(s,1024);
	vector<string> dataList;
	vector<string> opList;
	GetData(dataList,s,"+-");
	GetData(opList,s,"0123456789 ");

	switch(opList[0].c_str()[0]){
	case '+':
		cout<<atol(dataList[0].c_str())+atol(dataList[1].c_str())<<endl;
		break;
	case '-':
		cout<<atol(dataList[0].c_str())-atol(dataList[1].c_str())<<endl;
		break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int Gets(char*, int)':
a.cc:10:25: error: 'strlen' was not declared in this scope
   10 |         size_t strLen = strlen(buff);
      |                         ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc: In function 'int GetData(std::vector<std::__cxx11::basic_string<char> >&, char*, char*)':
a.cc:21:28: error: 'strlen' was not declared in this scope
   21 |         char *p = new char[strlen(line)+1];
      |                            ^~~~~~
a.cc:21:28: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:22:9: error: 'strcpy' was not declared in this scope
   22 |         strcpy(p,line);
      |         ^~~~~~
a.cc:22:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:23:23: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
   23 |         char* token = strtok(p, deli);
      |                       ^~~~~~
      |                       strtoq
a.cc: In function 'int main(int, char**)':
a.cc:37:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   37 |         GetData(dataList,s,"+-");
      |                            ^~~~
a.cc:38:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   38 |         GetData(opList,s,"0123456789 ");
      |                          ^~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class A050 {

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

}


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

package atcoder.beg50;

import java.util.Scanner;

public class A050 {

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

}


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

#incluide<cstdio>

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incluide; did you mean #include?
    1 | #incluide<cstdio>
      |  ^~~~~~~~
      |  include
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
    7 |   scanf("%d%c%d", &A, &op, &B);
      |   ^~~~~
a.cc:8:3: error: 'printf' was not declared in this scope
    8 |   printf("%d\n", op == '+' ? A + B : A - B);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #incluide<cstdio>
Language: Java

import java.util.Scanner;
 
public class Main
{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    byte op = sc.nextByte();
    int B = sc.nextInt();
    int answer;
    if (op == '+')
        answer = A + B;
    else if (op == '-')
        answer = A - B;
    System.out.println("" + answer);
  }
}

Compiler output:
Main.java:15: error: variable answer might not have been initialized
    System.out.println("" + answer);
                            ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main
{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    byte op = sc.nextByte();
    int B = sc.nextInt();
    int answer;
    if (op == '+')
        answer = A + B;
    else if (op == '-')
        answer = A - B;
    System.out.print("" + answer);
  }
}

Compiler output:
Main.java:15: error: variable answer might not have been initialized
    System.out.print("" + answer);
                          ^
1 error
Language: Java

import java.util.Scanner;

pubilc class Main
{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    byte op = sc.nextByte();
    int B = sc.nextInt();
    int answer;
    if (op == '+')
        answer = A + B;
    else if (op == '-')
        answer = A - B;
    System.out.print("" + answer);
  }
}


Compiler output:
Main.java:3: error: class, interface, enum, or record expected
pubilc class Main
^
1 error
Language: C

#include<stdio.h>

int main() {
int a,b;
char op;
scanf("%d %c %d",&a,&op,&b);

if(op == '-'){
print("%d\n",a-b);
} else {
print("%d\n",a+b);
}

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    9 | print("%d\n",a-b);
      | ^~~~~
      | printf
Language: C++

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

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

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

#include <iostrem>

using namespace std;

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

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

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

Compiler output:
main.c: In function 'main':
main.c:8:8: error: expected expression before ')' token
    8 | if(c==+){
      |        ^
main.c:11:8: error: expected expression before ')' token
   11 | if(c==-){
      |        ^
Language: C

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

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

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

int main() {

	char str[100];
	gets(str);

	long a, b;
	char op;
	sscanf(str, "%ld %c %ld", &a, &op, &b);

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

	cerr << a  << ' ' << op << ' ' << b;
	printf("%ld", ans);

	return 0;
}

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

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

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

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

int main() {

	char str[100];
	gets(str);

	int a, b;
	char op;
	sscanf(str, "%d %c %d", &a, &op, &b);

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

	cout << ans << '\n';

	return 0;
}

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

import java.util.Scanner;

public class main {
    public static void main(String[] args){

        try {
            Scanner scan = new Scanner(System.in);
            int a = scan.nextInt();
            String b = scan.next();
            int c = scan.nextInt();

            if (b.equals("+")) {
                a = a+c;
                System.out.println(a);
            } else {
                System.out.println(b);
                a= a-c;
                System.out.println(a);
            }
        }catch (Exception e){}
    }


}


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

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:12:11: error: 'EXIT_SUCCESS' undeclared (first use in this function)
   12 |    return EXIT_SUCCESS;
      |           ^~~~~~~~~~~~
main.c:2:1: note: 'EXIT_SUCCESS' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
   12 |    return EXIT_SUCCESS;
      |           ^~~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc:5:1: error: expected primary-expression before 'int'
    5 | int a,b;
      | ^~~
a.cc:4:2: error: expected ']' before 'int'
    4 | [
      |  ^
      |  ]
    5 | int a,b;
      | ~~~
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> a >> c >> b;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'if'
    8 | if(c == '+')cout << a + b << endl;
      | ^~
a.cc:9:1: error: expected unqualified-id before 'else'
    9 | else cout << a - b << endl;
      | ^~~~
a.cc:10:1: error: expected unqualified-id before 'return'
   10 | return 0;
      | ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include <set>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>

#define  mp make_pair
#define pb push_back
#define  X first
#define  Y second

using namespace std;
typedef long long LL;
const int maxn = 100005;
char res[maxn];
int id;
void init() {
    int a,b;
    char op;
    scanf("%d%c%d",&a,&c,&b);
    if(c=='+')
        cout<<a+b<<endl;
    else cout<<a-b<<endl;
}

int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif // LOCAL
    init();
    return 0;
}


Compiler output:
a.cc: In function 'void init()':
a.cc:24:24: error: 'c' was not declared in this scope
   24 |     scanf("%d%c%d",&a,&c,&b);
      |                        ^
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
static const int R = 10000;

int main(){
	int n[R],t,m;
	int sum = 0;
	int k = 0;
	cin >> t;
	for( int i = 0, i < n, i++) cin >> n[i];
	cin >> m;
	for( int i = 0, i < m, i++) {
		cin >> number >> sec;
		n[number - 1] = sec;
			for( int i = 0, i < t, i++){
				sum += n[i];
				cout << sum << endl;
			}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before '<' token
   12 |         for( int i = 0, i < n, i++) cin >> n[i];
      |                          ^~
      |                          ;
a.cc:12:27: error: expected primary-expression before '<' token
   12 |         for( int i = 0, i < n, i++) cin >> n[i];
      |                           ^
a.cc:12:35: error: expected ';' before ')' token
   12 |         for( int i = 0, i < n, i++) cin >> n[i];
      |                                   ^
      |                                   ;
a.cc:14:26: error: expected ';' before '<' token
   14 |         for( int i = 0, i < m, i++) {
      |                          ^~
      |                          ;
a.cc:14:27: error: expected primary-expression before '<' token
   14 |         for( int i = 0, i < m, i++) {
      |                           ^
a.cc:14:35: error: expected ';' before ')' token
   14 |         for( int i = 0, i < m, i++) {
      |                                   ^
      |                                   ;
a.cc:15:24: error: 'number' was not declared in this scope
   15 |                 cin >> number >> sec;
      |                        ^~~~~~
a.cc:15:34: error: 'sec' was not declared in this scope
   15 |                 cin >> number >> sec;
      |                                  ^~~
a.cc:17:42: error: expected ';' before '<' token
   17 |                         for( int i = 0, i < t, i++){
      |                                          ^~
      |                                          ;
a.cc:17:43: error: expected primary-expression before '<' token
   17 |                         for( int i = 0, i < t, i++){
      |                                           ^
a.cc:17:51: error: expected ';' before ')' token
   17 |                         for( int i = 0, i < t, i++){
      |                                                   ^
      |                                                   ;
a.cc:22:10: error: expected '}' at end of input
   22 |         }
      |          ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

#define rep(a, b) for(int a  = 0; a < b; a++)
#define repr(a, b) for(int a = b; a >= 0; a++)

using namespace std;

int main() {
    int N;
    cin >> N;
    int A[N];
    rep(i, N) cin >> A[i];
    int count[(N + 1) / 2];
    rep(i, (N + 1) / 2) count[i] = 0;
    if (N % 2 == 0) {
        rep(i, N) {
            int index = A[i] / 2;
            count[index] += 1;
            if (count[index] > 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        cout << pow(2, N / 2) << endl;
    } else {
        rep(i, N) {
            int index = A[i] / 2;
            count[index] += 1;
            if (index == ((N + 1) / 2)) {
                if (count[A[i]] > 1) {
                    cout << 0 << endl;
                    return 0;
                }
            }
            if (count[index] > 2) {
                cout << 0 << endl;
                return 0;
            }
        }
        cout << pow(2, N / 2) % 1000000007 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:31: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   42 |         cout << pow(2, N / 2) % 1000000007 << endl;
      |                 ~~~~~~~~~~~~~ ^ ~~~~~~~~~~
      |                    |            |
      |                    |            int
      |                    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
using namespace std;

typedef unsigned long long uint;

int main() {
	// your code goes here
	long long 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:4:28: error: conflicting declaration 'typedef long long unsigned int uint'
    4 | typedef unsigned long long uint;
      |                            ^~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:150:22: note: previous declaration as 'typedef unsigned int uint'
  150 | typedef unsigned int uint;
      |                      ^~~~
Language: C++

using System;


namespace ConsoleApplication
{
    public class A
    {
        int a, b;
        string op;
        public A() 
        {
            string[] s = Console.ReadLine().Split(' ');
            this.a = int.Parse(s[0]);
            this.b = int.Parse(s[2]);
            this.op = s[1];
        }

        public void run() 
        {
            if (op == "+") {
                System.Console.WriteLine(a+b);
            } else {
                System.Console.WriteLine(a-b);
            }
        }
    }

    public class Program
    {
        public static void Main(string[] args)
        {
            var a = new A();
            a.run();
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:6:5: error: expected unqualified-id before 'public'
    6 |     public class A
      |     ^~~~~~
a.cc:28:5: error: expected unqualified-id before 'public'
   28 |     public class Program
      |     ^~~~~~
Language: C++

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

int main(void){
  long long int a,b;
  char c;
  scanf("%lld %c %lld",&a,&c.&b);
  if(c=='+') printf("%lld\n",a+b);
  else printf("%lld\n",a-b);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected unqualified-id before '&' token
   10 |   scanf("%lld %c %lld",&a,&c.&b);
      |                              ^
Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc060
{
    class Program
    {
        static void Main(string[] args)
        {
            //a
            string[] s = Console.ReadLine().Split(' ');
            int a, b;
            string op;

            a = int.Parse(s[0]);
            b = int.Parse(s[2]);
            op = s[1];

            if (op == "+")
                Console.WriteLine(a + b);
            else
                Console.WriteLine(a - b);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:27:6: error: expected ';' after class definition
   27 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void abc060::Program::Main(int*)':
a.cc:14:13: error: 'string' was not declared in this scope
   14 |             string[] s = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:14:20: error: expected primary-expression before ']' token
   14 |             string[] s = Console.ReadLine().Split(' ');
      |                    ^
a.cc:16:20: error: expected ';' before 'op'
   16 |             string op;
      |                    ^~
a.cc:18:17: error: expected primary-expression before 'int'
   18 |             a = int.Parse(s[0]);
      |                 ^~~
a.cc:19:17: error: expected primary-expression before 'int'
   19 |             b = int.Parse(s[2]);
      |                 ^~~
a.cc:20:13: error: 'op' was not declared in this scope
   20 |             op = s[1];
      |             ^~
a.cc:20:18: error: 's' was not declared in this scope
   20 |             op = s[1];
      |                  ^
a.cc:23:17: error: 'Console' was not declared in this scope
   23 |                 Console.WriteLine(a + b);
      |                 ^~~~~~~
a.cc:25:17: error: 'Console' was not declared in this scope
   25 |                 Console.WriteLine(a - b);
      |                 ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

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

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

#include <iostream>

int main()
{
  int a, b;
  char c;
  cin >> a >> c >> b;
  cout << (c == '+') ? a + b : 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 >> c >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout << (c == '+') ? a + b : 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:41: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout << (c == '+') ? a + b : 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)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

//using namespace atcoder;
using namespace std;

int main(void){
  ll n;
  cin >> n;
  
  ll sum = 0;
  vector<ll> t(n);
  for (int i = 0; i < n; i++){
    cin >> t[i];
    sum += t[i];
  }
  ll m;
  cin >> m;
  
  for (int i = 0; i < m; i++){
    cin >> p >> x;
    cout << sum - x + t[p] << endl;
  }
  
  

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'p' was not declared in this scope
   25 |     cin >> p >> x;
      |            ^
a.cc:25:17: error: 'x' was not declared in this scope
   25 |     cin >> p >> x;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
   int N;
   cin >> N ;
 
   vector<int> T(N);
   for (int i = 0; i < N; i++) {
     cin >> T.at(i);
   } 
  
   int M;
   cin >> M;
  // int型の2次元配列(M×2要素の)の宣言
  vector<vector<int>> P(M, vector<int>(2));
 
  // 入力 (2重ループを用いる)
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> P.at(i).at(j);
    }
  }
  
  for (int i = 0; i < M; i++) {
    int total = 0; //合計
    int count = 0; // カウンタ変数
    while (count < N) {
        total += T.at(count);
      }        
  
    count++;
    } 
    
    cout << total << endl;   
  } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'total' was not declared in this scope
   36 |     cout << total << endl;
      |             ^~~~~
a.cc: At global scope:
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  vector<int> Q(N);
  int T=0;
  for(int i=0; i<N; i++){
    cin>>Q.at(i);
    T+=Q.at(i);
  }
  int M; cin>>M;
  vector<vector<int>> D(M,vector<int>(2));
  for(int i=0 ;i<M; i++){
    for(int j=0; j<2; j++){
      cin>>D.at(i).at(j);
    }
  }
  for(int i=0 ;i<N; i++){
    T-=Q.at(D.at(i).at(0)-1));
    cout<<T+D.at(i).at(1)<<endl;
     T+=Q.at(D.at(i).at(0)-1));
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:29: error: expected ';' before ')' token
   19 |     T-=Q.at(D.at(i).at(0)-1));
      |                             ^
      |                             ;
a.cc:21:30: error: expected ';' before ')' token
   21 |      T+=Q.at(D.at(i).at(0)-1));
      |                              ^
      |                              ;
Language: Java

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> T(N);
  for (int i = 0; i < N; i++) {cin >> T.at(i);}
  for (int i = 0; i < M; i++) {
    vector<int> t(N);
    for (int j = 0; j < N; j++) {t.at(j) = T.at(j);}
    int P, X, Y = 0;
    cin >> P >> X;
    t.at(P - 1) = X;
    for (int j = 0; j < N; j++) {Y += t.at(j);}
    cout << Y << endl;
  }
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: not a statement
  cin >> N >> M;
           ^
Main.java:6: error: not a statement
  vector<int> T(N);
                ^
Main.java:7: error: not a statement
  for (int i = 0; i < N; i++) {cin >> T.at(i);}
                                   ^
Main.java:9: error: not a statement
    vector<int> t(N);
                  ^
Main.java:12: error: not a statement
    cin >> P >> X;
             ^
Main.java:15: error: not a statement
    cout << Y << endl;
              ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ';' expected
  vector<int> T(N);
               ^
Main.java:6: error: ';' expected
  vector<int> T(N);
                 ^
Main.java:9: error: ';' expected
    vector<int> t(N);
                 ^
Main.java:9: error: ';' expected
    vector<int> t(N);
                   ^
13 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i , n) for (int i = 0; i < (int)(n); i++)
const int INF = 1<<29;
using namespace std;
using ll = long long;
ll l , a[500001];
int main(){
	int n , m , a[111] , b , c , sum = 0;
	cin >> n;
	for(int i = 1; i <= n; i++)
	    cin >> a[i];
        sum += a[i];
    }
	cin >> m;
	while(m--){
	    cin >> b >> c;
        cout << sum - a[b] + c << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: 'i' was not declared in this scope
   12 |         sum += a[i];
      |                  ^
a.cc: At global scope:
a.cc:14:9: error: 'cin' does not name a type
   14 |         cin >> m;
      |         ^~~
a.cc:15:9: error: expected unqualified-id before 'while'
   15 |         while(m--){
      |         ^~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,m,r;
	cin>>n;
	int t[n],p[m],x[m];
	for(int i=0;i<n;i++){
		cin>>t[i];
	}
	
	for(int j=0;j<p.length();j++){
		cin>>p[j]>>x[j];
	}
	for(int a=0;a<m;a++){
		for(int b=0;b<t.length();b++){
			if(b==a){
				continue;
			}
			r+=t[a];
		}
		
	cout<<r+t[a]<<endl;	
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: request for member 'length' in 'p', which is of non-class type 'int [m]'
   12 |         for(int j=0;j<p.length();j++){
      |                         ^~~~~~
a.cc:16:33: error: request for member 'length' in 't', which is of non-class type 'int [n]'
   16 |                 for(int b=0;b<t.length();b++){
      |                                 ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n,m,r;
	cin>>n;
	int t[n],p[m],x[m];
	for(int i=0;i<n;i++){
		cin>>t[i];
	}
	
	for(int j=0;j<m;j++){
		cin>>p[j]>>x[j];
	}
	for(int a=0;a<j;a++){
		for(int b=0;b<i;b++){
			if(b==a){
				continue;
			}
			r+=t[a];
		}
		
	cout<<r+t[a]<<endl;	
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: 'j' was not declared in this scope
   15 |         for(int a=0;a<j;a++){
      |                       ^
a.cc:16:31: error: 'i' was not declared in this scope
   16 |                 for(int b=0;b<i;b++){
      |                               ^
Language: C++

#include <iostream>
using namespace std;

int main (){
  int total = 0;
  int N, M;
  int arrT, arrP, arrX;
  cin >> N >> M;
  for (int i = 0; i < N; i ++){
    cin >> arrT[i];
  }
  for  (int i = 0; i < M; i ++){
    cin >> arrP[i] >> arrX[i];
    for (int j = 0; j < N; j ++){
      if (j == arrP[i]){
        total += arrX[i];
      } else {
        total += arrT[j];
      }
    }
    cout << total << '\n';
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: invalid types 'int[int]' for array subscript
   10 |     cin >> arrT[i];
      |                ^
a.cc:13:16: error: invalid types 'int[int]' for array subscript
   13 |     cin >> arrP[i] >> arrX[i];
      |                ^
a.cc:13:27: error: invalid types 'int[int]' for array subscript
   13 |     cin >> arrP[i] >> arrX[i];
      |                           ^
a.cc:15:20: error: invalid types 'int[int]' for array subscript
   15 |       if (j == arrP[i]){
      |                    ^
a.cc:16:22: error: invalid types 'int[int]' for array subscript
   16 |         total += arrX[i];
      |                      ^
a.cc:18:22: error: invalid types 'int[int]' for array subscript
   18 |         total += arrT[j];
      |                      ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] t = new int[n];
		for(int i=0; i<n; i++){
			a[i] = scn.nextInt();
		}
      	int sum = 0;
      	for(int i=0; i<n; i++){
          sum += a[i];
        }
      	int m = scn.nextInt();
		int[] p = new int[m];
      	int[] x = new int[m];
		for(int i=0; i<m; i++){
			p[i] = scn.nextInt();
          	x[i] = scn.nextInt();
		}
      	int dif = 0;
      	for(int i=0; i<m; i++){
          dif = a[p[i]]-x[i];
          System.out.println(sum-dif);
        }
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
			a[i] = scn.nextInt();
			^
  symbol:   variable a
  location: class Main
Main.java:13: error: cannot find symbol
          sum += a[i];
                 ^
  symbol:   variable a
  location: class Main
Main.java:24: error: cannot find symbol
          dif = a[p[i]]-x[i];
                ^
  symbol:   variable a
  location: class Main
3 errors
Language: C

#include <iostream>
#include <array>

using namespace std;

int main(){
    int N, M, k, val, sum = 0, ans;

    array<int, 100> p;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> p[i];
        sum += p[i];
    }

    cin >> M;
    for(int i = 0; i < M; i++){
        cin >> k >> val;
        cout << sum + val - p[k - 1] << '\n';
    }
    
}

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

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

int main() {
  int n ;
  cin >> n;
  vector < pair <int , int> > a(n);
  int sum = 0 ;
  for ( int i=0 ; i<n ; i++){
    int t ;
    cin >> t;
    a.at(i) = make_pair ( i, t);
    sum += t;
  }
  int m ;
  cin >> m;
  for ( int i=0 ; i<m ; i++) {
    int p,b,c,t , ans;
    cin >> p >> b;
    tie(c,t) = a.at (p-1) ;
    ans = sum - t + b
      cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: expected ';' before 'cout'
   21 |     ans = sum - t + b
      |                      ^
      |                      ;
   22 |       cout << ans << endl;
      |       ~~~~
Language: C++

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

int main() {
	int N;
	vector<int>T(N);
	int sum = 0;
	for (int i = 0; i < N; ++i) {
		cin >> T[i];
		sum + = T[i];
	}
	int M;
	cin >> M;
	for (int i = 0; i < M; ++i) {
		int p, x;
		cin >> p >> x;
		cout << sum - T[p - 1] + x << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected primary-expression before '=' token
   10 |                 sum + = T[i];
      |                       ^
Language: C++

v#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  
  vector<int> t(n);
  for (int i = 0; i < n; i++)
    cin >> t.at(i);
  
  int m;
  cin >> m;
  
  int p, x, ans, temp;
  
  for (int i = 0; i < m; i++) {
    cin >> p >> x;
    
    temp = t.at(p-1);
    t.at(p-1) = x;
    
    ans = 0;
    for (int y : t) ans += y;
    cout << ans << endl;
    
    t.at(p-1) = temp;
  }
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> t(n);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> t(n);
      |          ^~~
a.cc:10:12: error: 't' was not declared in this scope
   10 |     cin >> t.at(i);
      |            ^
a.cc:20:12: error: 't' was not declared in this scope
   20 |     temp = t.at(p-1);
      |            ^
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << ans << endl;
      |     ^~~~
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

int main() {
  int N ;
  cin >> N ;
  vector <int> a(N);
  int sum = 0 ;
  for ( int i=0 ; i<N ; i++){
    cin >> a.at(i) ;
    sum += a.at(i) ;
  }
  int M ;
  cin >> M ;
  vector <int> d(N,sum)
  for ( int i=0 ; i<M ; i++){
    int b,c;
    cin >> b >> c ;
    d.at(i) = d.at(i)-a.at(b) +c;
    cout << d.at(i) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for ( int i=0 ; i<M ; i++){
      |   ^~~
a.cc:16:19: error: 'i' was not declared in this scope
   16 |   for ( int i=0 ; i<M ; i++){
      |                   ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  ll N;cin>>N;
  ll T[N];
  ll sum=0;
  rep(i,N){
    cin>>T[N];
    ans+=T[i];
  }
  ll M;cin>>M;
  ll P[M],X[M];
  rep(i,N) cin>>P[i]>>X[i];
  
  for(int i=0;i<M;i++){
    ll ans=sum;
    ans-=T[P[i]-1];
    ans+=X[i];
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans+=T[i];
      |     ^~~
      |     abs
Language: C++

#include<isotream>
using namespace std;
int main(){
  int n;
  int arr[n];
  for(int i = 0; i < n; ++i){
    cin >> arr[i];
  }
  int m;
  while(m--){
    int x, y;
    cin >> x >> y;
    int ans = 0;
    for(int i = 0; i < n; ++i){
      if((i + 1) == x) ans += y;
      else ans += arr[i];
    }
    cout << ans << endl;
  }
}

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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int[] T = new int[N];		
		int M = scan.nextInt();
		int[] P = new int[M];
		int[] X = new int[M];		
		
		for(int i = 0; i < N; i++) {
			T[i] = scan.nextInt();
		}		
		for(int i = 0; i < M; i++) {
			P[i] = scan.nextInt();
			X[i] = scan.nextInt();
		}
		
		for(int i = 0; i < M; i++) {
			int sum = 0;
			for(int j = 0; j < N; j++) {
				sum += T[j];
			}
			int num = T[P[i] - 1] - X[i];
			int ans = sum - num;
			System.out.println(ans);
		}
		
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

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

    P--;
    cout << sum - T[P] + X << endl; 
  }
}

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

#include <iostream>

using namespace std;


int t[h];

int main()
{
    int n;
    cin >> n;
    int i = 1;
    while(n --)
    {
        cin >> t[i];
        i ++;
    }
    int m;
    cin >> m;
    while(m --)
    {
        int p, x;
        cin >> p >> x;
        int c;
        c = t[p];
        t[p] = x;
        int sum = 0;
        for(int j = 1; j < i; j ++)
        {
            sum += t[j];
        }
        cout << sum <<endl;
        t[p] = c;
    }
    return 0;
}


Compiler output:
a.cc:6:7: error: 'h' was not declared in this scope
    6 | int t[h];
      |       ^
a.cc: In function 'int main()':
a.cc:15:16: error: 't' was not declared in this scope
   15 |         cin >> t[i];
      |                ^
a.cc:25:13: error: 't' was not declared in this scope
   25 |         c = t[p];
      |             ^
Language: Java

import java.util.Scanner;

public class Main {

	private static final long x = (long) Math.pow(10, 18);

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int t[] = new int[n];
		int px[][] = new int[m][2];

		int sum = 0;
		for (int i = 0; i < n; i++) {
			t[i] = sc.nextInt();
			sum += t[i];
		}

		int m = sc.nextInt();

		for (int i = 0; i < m; i++) {
			px[i][0] = sc.nextInt();
			px[i][1] = sc.nextInt();
		}

		for (int i = 0; i < m; i++) {
			System.out.println(sum - t[px[i][0] - 1] + px[i][1]);
		}

		sc.close();
	}

}


Compiler output:
Main.java:11: error: cannot find symbol
		int px[][] = new int[m][2];
		                     ^
  symbol:   variable m
  location: class Main
1 error
Language: C++

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

int main(){
  int N,M;
  cin >> N;
  long T[N],Sum=0;
  for(int i=1;i<=N;i++){
    cin >> T[i];
    Sum += T[i];
    Tp[i]=0;
  }
  cin >> M;
  long Tp[N];
  for(int j=0;j<M;j++){
    int p,X;
    cin >> p;
    cin >> X;
    Tp[p]=X;
  }
  for(int i=1;i<N;i++){
    res = Sum -T[i] + Tp[i];
    cout << res << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'Tp' was not declared in this scope; did you mean 'T'?
   11 |     Tp[i]=0;
      |     ^~
      |     T
a.cc:22:5: error: 'res' was not declared in this scope
   22 |     res = Sum -T[i] + Tp[i];
      |     ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n; cin>>n;//問題数
  int t[]={};
  for(int i=0;i<n;i++){
    cin>>t[i];//問題を解くのにかかる時間
  }
  int m; cin>>m;//ドリンクの種類
  int p,x;
  for(i=0;i<m;i++){
    int ans=0;
    cin>>p>>x;
    for(int j=0;j<n;j++){
      ans+=t[j];
    }
    cout<<ans;
  }
  return 0;
}

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

#include<map>
using namespace std;

int main(){
    int n;
    cin >> n;
    int sum = 0;
    int T[n];
    for(int i=0;i<n;i++){
        cin >> T[i];
        sum += T[i];
    }
    int m;
    cin >> m;
    for(int i=0;i<m;i++){
        int p,x;
        cin >> p >> x;
        p--;
        cout << sum - T[p] + x << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> n;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<map>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << sum - T[p] + x << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:35: error: 'endl' was not declared in this scope
   19 |         cout << sum - T[p] + x << endl;
      |                                   ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<map>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

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

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); 
	int n; cin >> n;
	vector<int> probs;
	vector<int> temp;
	for(int i{}; i<n; i++){
		int b; cin >> b;
		probs.push_back(b);
	}
	temp=probs;

	int m; cin >> m;
	for(int i{}; i<m; i++){
		probs = temp;
		int p,x;
		cin >> p >> x;
		probs[p-1] = x;
		int sum{};

	for(int j{}; j<n; j++){
		sum+=probs[j];
	}
		cout << sum << "\n";
	}










 return 0;
}


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