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

# AtCoder Grand Contest 033
# https://atcoder.jp/contests/agc033
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))



def main():
    N, K = i2nn()
    print(N - K + 1)
main()


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #AtCoder
    1 | # AtCoder Grand Contest 033
      |   ^~~~~~~
a.cc:2:3: error: invalid preprocessing directive #https
    2 | # https://atcoder.jp/contests/agc033
      |   ^~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

int main() {
    int n,k;
    cin >> n >> k;
 
    cout << n-k+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n >> k;
      |     ^~~
a.cc:5:5: error: 'cout' was not declared in this scope
    5 |     cout << n-k+1 << endl;
      |     ^~~~
a.cc:5:22: error: 'endl' was not declared in this scope
    5 |     cout << n-k+1 << endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  int n,k;
  cin >> n >> k;
  cout >> n-k+1 >> endl;
}

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

import java.util.Scanner;

public class java {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int k = scanner.nextInt();
		System.out.println((n - k) + 1);

	}


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

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

		int n, k;
		n = teclado.nextInt();
		k = teclado.nextInt();
		int count =0;
		int soma;
      
		if(k <= n && n <=50 && 1 <= k ) {
			for(int i=k-1; i <n ;i ++) {
				soma=i+i+1;
				count++;
			}
		}
		System.out.println(count);
	}
}


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

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

		int n, k;
		n = teclado.nextInt();
		k = teclado.nextInt();
		int count =0;
		int soma;
      
		if(k <= n && n <=50 && 1 <= k ) {
			for(int i=k-1; i <n ;i ++) {
				soma=i+i+1;
				count++;
			}
		}
		System.out.println(cont);
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner teclado = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner teclado = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
Main.java:17: error: cannot find symbol
		System.out.println(cont);
		                   ^
  symbol:   variable cont
  location: class Main
3 errors
Language: C++


using namespace std;

#include <vector>
#include <string>
#include <stdio.h>
#include <sstream>      // std::ostringstream
std::vector<int> split(const std::string &str, char sep)
{
    std::vector<int> v;
    std::stringstream ss(str);
    std::string buffer;
    while( std::getline(ss, buffer, sep) ) {
        v.push_back(stoi(buffer));
    }
    return v;
}

int main()
{
   char sep = ' ';
   vector<int> vector_in = split(cin,sep);
   cout = vector_in[0] - vector_in[1] + 1;

   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: 'cin' was not declared in this scope
   22 |    vector<int> vector_in = split(cin,sep);
      |                                  ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include <sstream>      // std::ostringstream
  +++ |+#include <iostream>
    8 | std::vector<int> split(const std::string &str, char sep)
a.cc:23:4: error: 'cout' was not declared in this scope
   23 |    cout = vector_in[0] - vector_in[1] + 1;
      |    ^~~~
a.cc:23:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>

int main(){
 int K,N;
 cin >> N >> K;
 cout << N - K  + 1<< endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |  cin >> N >> K;
      |  ^~~
      |  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:6:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |  cout << N - K  + 1<< 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:6:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |  cout << N - K  + 1<< 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: Java



import java.util.Scanner;

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

		int n, k;
		n = teclado.nextInt();
		k = teclado.nextInt();
		int cont =0;
		int a;
		if(k <= n && n <=50 && 1 <= k ) {
			for(int i=k-1; i <n ;i ++) {
				a=i+i+1;
				cont++;
			
			}
		}
		System.out.println(cont);

	}

}

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

N = int(input())
a_count =0
b_count =0
ab_count =0
for i in range(N):
    test = str(input())
    if test[0] == "B":
        b_count +=1
    if test[-1] == "A":
        a_count += 1
    ab_count += test.count("AB")
print(ab_count+min(a_count,b_count))

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

using namespace std;

#include <vector>
#include <string>
#include <stdio.h>
#include <sstream>      // std::ostringstream
std::vector<int> split(const std::string &str, char sep)
{
    std::vector<int> v;
    std::stringstream ss(str);
    std::string buffer;
    while( std::getline(ss, buffer, sep) ) {
        v.push_back(stoi(buffer));
    }
    return v;
}

int main()
{
  
   char sep = ' ';
   vector vector_in = split(cin,sep);
   cout = vector_in[0] - vector_in[1] + 1;

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:29: error: 'cin' was not declared in this scope
   22 |    vector vector_in = split(cin,sep);
      |                             ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <sstream>      // std::ostringstream
  +++ |+#include <iostream>
    7 | std::vector<int> split(const std::string &str, char sep)
a.cc:23:4: error: 'cout' was not declared in this scope
   23 |    cout = vector_in[0] - vector_in[1] + 1;
      |    ^~~~
a.cc:23:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.Scanner;

public class AtCoder {

    public static void Main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        int result = 0;
        for(int i = 1; i <= n; i++) {
            if((i + k - 1) <= n ) {
                result++;
            }
        }
        System.out.print(result);
        sc.close();
    }
}

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

int main(){
	int R, G, B, N;
	int r, g, b,r_max;
	int	ans;
	scanf("%d", &R); 
	scanf("%d", &G); 
	scanf("%d", &B); 
	scanf("%d", &N);
	r_max = N / R;
	for (int i = 1; i <= r_max; r++) {
		int t = N - i * R;
		int b_max = t / B;
		for (int j = 1; j <= b_max; i++){
			int s = t - j + B;
			if (s%G==0){
				ans++;
			}
		}

	}
	printf("%d", ans);
	return(0);
}

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

#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
	int a=0;
	int b=0;
	cin >> a;
	cin >> b;
	cout << (a-b+1);
	return 0;

}



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

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

int main() {
  int K,N;
  cin >> K >> N;
	K=K-n+1
      cout<< K;
  }



Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'n' was not declared in this scope
    7 |         K=K-n+1
      |             ^
Language: Java

import java.util.*;

public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int r = sc.nextInt();
        // スペース区切りの整数の入力
        int g = sc.nextInt();
        int b = sc.nextInt();
        int n = sc.nextInt();
        int ans = 0;
        //for文
        for(int i = 0; i < n / r + 1; i++){
            for(int j = 0; j < (n - (i * r)) / g + 1; j++){
                for(int k = 0; k < (n - (i * r + j * g) / b + 1; k++){
                    if(i * r + j * g + k * b == n) ans++;
                }
            }
        }
        // 出力
        System.out.println(ans);

    }

}


Compiler output:
Main.java:19: error: ')' expected
                for(int k = 0; k < (n - (i * r + j * g) / b + 1; k++){
                                                               ^
1 error
Language: C++

    int main() {
        int N,K;
        cin >> N >> K;

        cout << N - K + 1 << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N >> K;
      |         ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout << N - K + 1 << endl;
      |         ^~~~
a.cc:5:30: error: 'endl' was not declared in this scope
    5 |         cout << N - K + 1 << endl;
      |                              ^~~~
Language: C++

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

int main(){
  int N K;
  cin >> N >> K;
  int answer = N-(K-1);
  cout << answer << endl;
}
    
    
    
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'K'
    5 |   int N K;
      |         ^
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> K;
      |          ^
a.cc:6:15: error: 'K' was not declared in this scope
    6 |   cin >> N >> K;
      |               ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int a=0;
	int b=0;
	cin >> a;
	cin >> b;
	cout << (a-b+1);
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   10 |         return;
      |         ^~~~~~
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
int ans=1;
int ans2 =1;
  while(m!=0){
ans *= n;
n--;
ans2 *= m;
m--;
}
int ansf =ans1/ans2;
cout << ansf;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'ans1' was not declared in this scope; did you mean 'ansf'?
   18 | int ansf =ans1/ans2;
      |           ^~~~
      |           ansf
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
int ans=1;
int ans2 =1;
  while(m!=0){
ans *= n;
n--;
ans2 *= m
m--;
}
int ansf =ans1/ans2;
cout << ansf;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before 'm'
   15 | ans2 *= m
      |          ^
      |          ;
   16 | m--;
      | ~         
a.cc:18:11: error: 'ans1' was not declared in this scope; did you mean 'ansf'?
   18 | int ansf =ans1/ans2;
      |           ^~~~
      |           ansf
Language: C++

#include <iostream>

int main(){
	int a=0;
	int b=0;
	cin >> a;
	cin >> b;
	cout << (a-b+1);
	return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> a;
      |         ^~~
      |         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:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |         cout << (a-b+1);
      |         ^~~~
      |         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:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |         return;
      |         ^~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main（）
｛
    int n,m;
    cin>>n>>m;
    cout<<n-m+1<<endl;
     return 0;
｝


Compiler output:
a.cc:5:1: error: expected initializer before '\U0000ff5b'
    5 | ｛
      | ^~
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin>>n>>m;
      |     ^~~
a.cc:8:5: error: 'cout' does not name a type
    8 |     cout<<n-m+1<<endl;
      |     ^~~~
a.cc:9:6: error: expected unqualified-id before 'return'
    9 |      return 0;
      |      ^~~~~~
a.cc:10:1: error: '\U0000ff5d' does not name a type
   10 | ｝
      | ^~
Language: C++

#include <iostream>
using namespace std;
#define rep(v,n) for(int v=0;v<n;v++)
int main(){
int r,g,b,n;
cin>>r>>g>>b>>n;
int sum=0;
rep(i,r){
if(i+r+g<n)continue;
rep(j,g){
if(I+j+b<n)continue;
sun+=1;
}
}
cout<<sum;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: 'I' was not declared in this scope
   11 | if(I+j+b<n)continue;
      |    ^
a.cc:12:1: error: 'sun' was not declared in this scope; did you mean 'sum'?
   12 | sun+=1;
      | ^~~
      | sum
Language: C++


#include "stdafx.h"
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <utility>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100000000;
char maze[1001][1001];
int d[1001][1001];
bool pre[1001][1001];
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

#define REP(i, a,b) for(i=a;i<b;i++) 
#define REP1(i,b,a) for(i=b-1;i>=a;i--)
#define output(x) cout<<x<<endl;
#define pb(x) push_back(x);
const int MOD = 1000000007;


int main() {
	ll i, j, k, l, m, n, sum, flag, cc, M, X, N,Y,Z,K;
	cin >> N>>M;
	output(N-M+1);
	return 0;
}





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

#include<bits\stdc++.h>
using namespace std;
int main（）
｛
    int n,m;
    cin>>n>>m;
    cout<<n-m+1<<endl;
     return 0;
｝


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

import java.util.*;
class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        sc.close();
        System.out.println((n-k+1)+"\n");
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:11: error: expected ':' before 'static'
    3 |     public static void main(String[] args)throws Exception{
      |           ^~~~~~~
      |           :
a.cc:3:29: error: 'String' has not been declared
    3 |     public static void main(String[] args)throws Exception{
      |                             ^~~~~~
a.cc:3:38: error: expected ',' or '...' before 'args'
    3 |     public static void main(String[] args)throws Exception{
      |                                      ^~~~
a.cc:3:42: error: expected ';' at end of member declaration
    3 |     public static void main(String[] args)throws Exception{
      |                                          ^
      |                                           ;
a.cc:3:43: error: 'throws' does not name a type
    3 |     public static void main(String[] args)throws Exception{
      |                                           ^~~~~~
a.cc:10:2: error: expected ';' after class definition
   10 | }
      |  ^
      |  ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main（）
｛
    int n,m;
    cin>>n>>m;
    cout<<n-m+1<<endl;
     return 0;
｝


Compiler output:
a.cc:4:1: error: expected initializer before '\U0000ff5b'
    4 | ｛
      | ^~
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin>>n>>m;
      |     ^~~
a.cc:7:5: error: 'cout' does not name a type
    7 |     cout<<n-m+1<<endl;
      |     ^~~~
a.cc:8:6: error: expected unqualified-id before 'return'
    8 |      return 0;
      |      ^~~~~~
a.cc:9:1: error: '\U0000ff5d' does not name a type
    9 | ｝
      | ^~
Language: C++

//
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <array>
#include <numeric>
#include <functional>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <complex>

using namespace std;

#define REP(i,m,n) for(int i=m;i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<int, int> pii;

const ll inf = INT_MAX;
const double eps = 1e-10;
const double pi = acos(-1.0);
const int di[][2] = {{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};

int main(){
	int n, k;
	cin >> n >> k;
	cout << n-k+1 << endl;
	return 0;
}


Compiler output:
a.cc:29:16: error: 'INT_MAX' was not declared in this scope
   29 | const ll inf = INT_MAX;
      |                ^~~~~~~
a.cc:19:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   18 | #include <complex>
  +++ |+#include <climits>
   19 |
Language: C++

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

int main(){
  int N,K;
  cin >> N >> k;
  cout << N-K+1 << endl;
}
  

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

#include<bits/stdc++.h>

using namespace std;

int main()
{
  int N,K;
  //string s;
  
  cin>>N>>K;


  cout<<(N-K+1)endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before 'endl'
   13 |   cout<<(N-K+1)endl;
      |                ^~~~
      |                ;
Language: C++

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

int Main() {
    int N, K, P;
    N = 10;
    std : cin >> N >> K;

    P = N - K + 1;
    cout << P << endl;

    return 0;
}


Compiler output:
/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 R,G,B,N; cin >> R >> G >> B >> N;
  
  int ans = 0;
  for(int i = 0; i <= N/R; i++){
    for(int j = 0; j <= N/G; j++){
      for(int k = 0; k <= N/B; k++){
        if(R*i+G*j+B*k == N) ans++;
      }
    }
  }
  cout << ans << endl;
}*/

int main(){
  intN,K; cin >> N >> K;
  
  cout << N - (K - 1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'intN' was not declared in this scope; did you mean 'int'?
   19 |   intN,K; cin >> N >> K;
      |   ^~~~
      |   int
a.cc:19:8: error: 'K' was not declared in this scope
   19 |   intN,K; cin >> N >> K;
      |        ^
a.cc:19:18: error: 'N' was not declared in this scope
   19 |   intN,K; cin >> N >> K;
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace;
int main（）
｛
    int n,m;
    cin>>n>>m;
    cout<<n-m+1<<endl;
     return 0;
｝

Compiler output:
a.cc:2:16: error: expected identifier before ';' token
    2 | using namespace;
      |                ^
a.cc:4:1: error: expected initializer before '\U0000ff5b'
    4 | ｛
      | ^~
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin>>n>>m;
      |     ^~~
a.cc:7:5: error: 'cout' does not name a type
    7 |     cout<<n-m+1<<endl;
      |     ^~~~
a.cc:8:6: error: expected unqualified-id before 'return'
    8 |      return 0;
      |      ^~~~~~
a.cc:9:1: error: '\U0000ff5d' does not name a type
    9 | ｝
      | ^~
Language: C++

#include <iostream>

using namespace std

int main() {

    int N,K;
    cin >> N >> K;

    cout << N - K + 1 << endl;


}

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

#include "pch.h"
#include "bits/stdc++.h"

typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define rep(i, n) for(int i = 1; i < (int)(n); i++)

using namespace std;
int main() {
	int N, K, res;
	cin >> N >> K;
	res = N - K + 1;
	cout << res << endl;
}


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

    #include<stdio.h>
     
    int main(void)
    {
      int a=0;
      int b=0;
      
      scanf("%d" , &a);
      scanf("%d" , &b);
      if((a-b)>=0){
      printf("%d" ,a-b+1 );
      }else{
        printf("該当する組み合わせはありません");
      }
      retrun 0;
    }

Compiler output:
main.c: In function 'main':
main.c:15:7: error: 'retrun' undeclared (first use in this function)
   15 |       retrun 0;
      |       ^~~~~~
main.c:15:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:13: error: expected ';' before numeric constant
   15 |       retrun 0;
      |             ^~
      |             ;
Language: Java

import java.util.*;

public class ABC126A{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        // スペース区切りの整数の入力
        int k = sc.nextInt();

        // 出力
        System.out.println(n-k+1);

    }

}


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

import java.util.Scanner;

public class A_ConsecutiveIntegers {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();

		System.out.println(N-K+1);
	}
}

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

#includestdio.h>

int main(void)
{
  int a=0;
  int b=0;
  
  scanf("%d" , &a);
  scanf("%d" , &b);
  if((a-b)>=0){
  printf("%d" ,a-b+1 );
  }else{
    printf("該当する組み合わせはありません");
  }
  retrun 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includestdio
    1 | #includestdio.h>
      |  ^~~~~~~~~~~~
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d" , &a);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includestdio.h>
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d" , &a);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   printf("%d" ,a-b+1 );
      |   ^~~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   13 |     printf("該当する組み合わせはありません");
      |     ^~~~~~
main.c:13:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:3: error: 'retrun' undeclared (first use in this function)
   15 |   retrun 0;
      |   ^~~~~~
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:9: error: expected ';' before numeric constant
   15 |   retrun 0;
      |         ^~
      |         ;
Language: C++

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

int main(){
    int n,k;
    cin>>n>>k;
    int m;
    m=n-k+1;
    cout<<m<<endl;
    return 0;
}

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

import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int R = sc.nextInt();
    int G = sc.nextInt();
    int B = sc.nextInt();
    int N = sc.nextInt();

    os.println(visible);
  }
}

Compiler output:
Main.java:20: error: cannot find symbol
    os.println(visible);
               ^
  symbol:   variable visible
  location: class Main
1 error
Language: C

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





Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'n' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:12: error: 'k' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |            ^
Language: C++

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

int main(){
    int n,k;
    cin>>n>>k;
    cout<<n-k+1<<endl;
    return 0;
}

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

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

	printf("%d", a - b + 1);
	return 0;
}

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

#include <stdio.h>
int main(){
int a,b,ans = 0;
scanf("%d",&a);
scanf("%d",&b);
  ans = (n-k)+1;
  print("%d",ans);
  return 0;
}





Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'n' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:12: error: 'k' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |            ^
main.c:7:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    7 |   print("%d",ans);
      |   ^~~~~
      |   printf
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n,k; cin >> n >> k;
  cout << n-k+1;
  
  retunr 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'retunr' was not declared in this scope
    8 |   retunr 0;
      |   ^~~~~~
Language: C

include<stdio.h>

int main(){
  int n,k;
  scanf("%d",&n);
  scanf("%d",&k);
  printf("%d\n",((n-k)+1));
  return 0;
}

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

#include <stdio.h>
int main(){
int a,b,ans = 0;
scanf("%d",&a);
scanf("%d",&b);
  ans = (n-k)+1;
  print("%d",ans);
}





Compiler output:
main.c: In function 'main':
main.c:6:10: error: 'n' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |          ^
main.c:6:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:12: error: 'k' undeclared (first use in this function)
    6 |   ans = (n-k)+1;
      |            ^
main.c:7:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    7 |   print("%d",ans);
      |   ^~~~~
      |   printf
Language: Java

import java.util.Scanner;

public class Problem {

	int[] arr = new int[100];
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Problem  A = new Problem();
		A.solve();
	}
	
	public void solve() {
		
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(n-m+1);
	}
}


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


import java.util.*;
import java.math.*;
public class Mainf {

	static   Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int N = sc.nextInt();
		int K = sc.nextInt();
		String msg = "No";
	
		
		System.out.println(N - K + 1);

		
	}

}


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

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */

    int n = sc.nextInt();
    int k = sc.nextInt();

    os.println(n - k + 1);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
  static void solve(InputStream is, PrintStream os) {
                    ^
  symbol:   class InputStream
  location: class Main
Main.java:7: error: cannot find symbol
  static void solve(InputStream is, PrintStream os) {
                                    ^
  symbol:   class PrintStream
  location: class Main
Main.java:8: error: cannot find symbol
    Scanner sc = new Scanner(is);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
    Scanner sc = new Scanner(is);
                     ^
  symbol:   class Scanner
  location: class Main
4 errors
Language: C

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int n,k;
int main(){
	scanf("%d%d",&n,&k);
	printf("%d",n+1-k);
	return 0;
}

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

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

int main() {
    int n=0, k=0;
    scanf("%d %d", &n, &k);
    printf("%d\n", n-k+1;
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:25: error: expected ')' before ';' token
    9 |     printf("%d\n", n-k+1;
      |           ~             ^
      |                         )
main.c:10:14: error: expected ';' before '}' token
   10 |     return 0;
      |              ^
      |              ;
   11 | }
      | ~
Language: C++

#include <iostream>
int main()
{
	int n, k;
	cin >> n >> k;
  	cout << (n - k + 1) << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> n >> k;
      |         ^~~
      |         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:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout << (n - k + 1) << 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:6:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         cout << (n - k + 1) << endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int N,K,n;
  cin >> N >> K;
  n=N+1-k
    cout << n << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'k' was not declared in this scope
    7 |   n=N+1-k
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K,a;
  cin >>N>>K;
  a=N+1-K
  cout <<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected ';' before 'cout'
    6 |   a=N+1-K
      |          ^
      |          ;
    7 |   cout <<a<<endl;
      |   ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,k;
    cin >> n >> k;
    cout << n-k+1 endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected ';' before 'endl'
    6 |     cout << n-k+1 endl;
      |                  ^~~~~
      |                  ;
Language: C++

main() {
	int N;
	scanf("%d", &N);
	int k;
	scanf("%d", &k);
	int answer = N - k+1;
	printf("%d", answer);
	return 0;

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
    3 |         scanf("%d", &N);
      |         ^~~~~
a.cc:7:9: error: 'printf' was not declared in this scope
    7 |         printf("%d", answer);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main() {
a.cc:8:18: error: expected '}' at end of input
    8 |         return 0;
      |                  ^
a.cc:1:8: note: to match this '{'
    1 | main() {
      |        ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int N,K;
  cin>>N;
  cin>>K
  cout>>N-K+1
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before 'cout'
    7 |   cin>>K
      |         ^
      |         ;
    8 |   cout>>N-K+1
      |   ~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

using namespace std;
#define endl '\n'
#define eb emplace_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

// value
int N, K;
}

void solve() {

	cin >> N >> K;

	cout << N - K + 1 << endl;

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}

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

import javax.management.monitor.CounterMonitor;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        //変数
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        int answer=0;
        //List<Integer> list = new ArrayList<>();
        //int array[] = new int[];

        //
        Output o1=new Output();
        Euclid e1=new Euclid();
        Compute c1=new Compute();

        //入力
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();


        //処理
        answer=n-k+1;
        //出力
        System.out.println(answer);
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
        Output o1=new Output();
        ^
  symbol:   class Output
  location: class Main
Main.java:17: error: cannot find symbol
        Output o1=new Output();
                      ^
  symbol:   class Output
  location: class Main
Main.java:18: error: cannot find symbol
        Euclid e1=new Euclid();
        ^
  symbol:   class Euclid
  location: class Main
Main.java:18: error: cannot find symbol
        Euclid e1=new Euclid();
                      ^
  symbol:   class Euclid
  location: class Main
Main.java:19: error: cannot find symbol
        Compute c1=new Compute();
        ^
  symbol:   class Compute
  location: class Main
Main.java:19: error: cannot find symbol
        Compute c1=new Compute();
                       ^
  symbol:   class Compute
  location: class Main
6 errors
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main();. int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/












int N, K;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> K;
	int ans = N - K + 1;
	cout << ans << endl;
}


Compiler output:
a.cc:7:35: error: expected unqualified-id before '.' token
    7 | using namespace std; void _main();. int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
      |                                   ^
Language: C++

int main() {
  int n, k;
  
  cin >> n >> k;
  
  cout << n-k+1 <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> n >> k;
      |   ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << n-k+1 <<endl;
      |   ^~~~
a.cc:6:19: error: 'endl' was not declared in this scope
    6 |   cout << n-k+1 <<endl;
      |                   ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(void){
  int N,K,A;
  cin >> N >> K;
  A=N-K;
  A++
    cout << A << endl;
  return 0;
}

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

#include <iostream>
using namespace std;

int main() {
	int n,k
	cin>>n>>k;
	cout<<n-k+1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'cin'
    6 |         cin>>n>>k;
      |         ^~~
a.cc:7:17: error: 'k' was not declared in this scope
    7 |         cout<<n-k+1<<endl;
      |                 ^
Language: C++

import java.util.Scanner;

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

       System.out.println(N-K);


    }
}



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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M 1000005



int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    
    int n, k;
    cin >> n >> k
    cout << n - k + 1;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected ';' before 'cout'
   12 |     cin >> n >> k
      |                  ^
      |                  ;
   13 |     cout << n - k + 1;
      |     ~~~~
Language: C++

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

int32_ main()
{
  	ios::sync_with_stdio(0);
	int n, k;
  	cin >> n >> k;
  	cout << n-k+1;
  	return 0;
}

Compiler output:
a.cc:5:1: error: 'int32_' does not name a type; did you mean 'int32_t'?
    5 | int32_ main()
      | ^~~~~~
      | int32_t
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MAX 100000
const long long INF=1145141919,MOD=1e9+7;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const double EPS = 1e-9;    // 許容誤差。問題によって変える
//typedef complex<double> P;  // Point
//typedef vector<P> VP; //単純多角形
//#define X real()
//#define Y imag()
//#define LE(n,m) ((n) < (m) + EPS)
//#define GE(n,m) ((n) + EPS > (m))
//#define EQ(n,m) (abs((n)-(m)) < EPS)
//namespace std{
//    bool operator < (const P a, const P b){
//        return a.X != b.X ? a.X <b.X : a.Y < b.Y;
//    }
//}
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
//外積cross(a,b) = |a||b|sinθ
//double cross(const P& a, const P& b) {
 // return imag(conj(a)*b);
//}
//内積dot(a,b) = |a||b|cosθ
//double dot(const P& a, const P& b) {
  //return real(conj(a)*b);
//}
//Line
//struct L : public vector<P> {
  //L(const P &a, const P &b) {
    //push_back(a); push_back(b);
  //}
//};
//円
//struct C{
//  P p; double r;
//  C(const P &p, double r) : p(p), r(r) { }
//};
int main(){
    int n,k;
    cin>>n>>k;
    cout<<n-k++1<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:16: error: expected ';' before numeric constant
   43 |     cout<<n-k++1<<endl;
      |                ^
      |                ;
Language: C++

#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#define lli long long int
#define ll long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
  int a, b, c, N, K, ans;
  cin >> N >> K;
  ans = N - K + 1;
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin >> N >> K;
      |   ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <cmath>
  +++ |+#include <iostream>
    6 | #define lli long long int
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << ans;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		//		String line = reader.readLine();
		String[] str = reader.readLine().split(" ");
		int[] ab = new int[str.length];
		for (int i = 0; i < str.length; i++) {
			ab[i] = Integer.parseInt(str[i]);
		}
		int ans = ab[0] - ab[1] + 1;
			System.out.println(ans);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:11: error: 'n' undeclared (first use in this function)
    6 |     ans = n - k+1;
      |           ^
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:15: error: 'k' undeclared (first use in this function)
    6 |     ans = n - k+1;
      |               ^
Language: C++

#include <iostream>

int main()
{
    int n, k;
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin >> n >> k;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout << n - k + 1 << 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:7:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout << n - k + 1 << 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: Java

import java.util.*;

//int[] idx = new int[1];
//int val = sc.nextInt();

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int b=n-k+1;
        System.out.println(b);
        }
    }
}


Compiler output:
Main.java:16: error: class, interface, enum, or record expected
}
^
1 error