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

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define MOD (1000000007ll)
#define l_ength size
#define PI 3.14159265358979
 
void mul_mod(ll& a, ll b){
    a *= b;
    a %= MOD;
}
 
void add_mod(ll& a, ll b){
    b += MOD;
    a += b;
    a %= MOD;
}

int main(void){
    int a,b,n,x,y,i,j
    ll dp[20][20];
    bool cst[20][20];
    cin >> a >> b;
    while(a || b){
        fill(cst[0],cst[20],false);
        cin >> n;
        for(i=0; i<n; ++i){
            cin >> x >> y;
            --x; --y;
            cst[x][y] = true;
        }
        for(i=0; i<a; ++i){
            for(j=0; j<b; ++j){
                if(cst[i][j]){
                    dp[i][j] = 0ll;
                }else if(!(i && j)){
                    dp[i][j] = 1ll;
                }else{
                    dp[i][j] = dp[i-1][j] + dp[i][j-1];
                }
            }
        }
        cout << dp[a-1][b-1] << endl;
        cin >> a >> b;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: expected initializer before 'll'
   25 |     ll dp[20][20];
      |     ^~
a.cc:37:17: error: 'j' was not declared in this scope
   37 |             for(j=0; j<b; ++j){
      |                 ^
a.cc:39:21: error: 'dp' was not declared in this scope; did you mean 'dup'?
   39 |                     dp[i][j] = 0ll;
      |                     ^~
      |                     dup
a.cc:41:21: error: 'dp' was not declared in this scope; did you mean 'dup'?
   41 |                     dp[i][j] = 1ll;
      |                     ^~
      |                     dup
a.cc:43:21: error: 'dp' was not declared in this scope; did you mean 'dup'?
   43 |                     dp[i][j] = dp[i-1][j] + dp[i][j-1];
      |                     ^~
      |                     dup
a.cc:47:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
   47 |         cout << dp[a-1][b-1] << endl;
      |                 ^~
      |                 dup
Language: C++

#include<stdio.h>
int a,b,cnt,flg[20][20],x,y;
int main(void)
{
	int n,i;
	while(1){
		scanf("%d%d",&a,&b);
		if(a==0&&b==0) break;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d%d",&x,&y);
			flg[x][y]=1;
		}
		cnt=0;
		func(1,1);
		printf("%d\n",cnt);
	}
	return 0;
}
int func(int x1,int y1){
	// printf("x1=%d y1=%d\n",x1,y1);
	if(x1==a&&y1==b) cnt++;
	else if(x1<=a&&y1<=b){
		if(flg[x1+1][y1]!=1&&x1+1<=a) func(x1+1,y1);
		if(flg[x1][y1+1]!=1&&y1+1<=b) func(x1,y1+1);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'func' was not declared in this scope
   15 |                 func(1,1);
      |                 ^~~~
a.cc: In function 'int func(int, int)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
Language: C++

#include<stdio.h>
int a,b,cnt,flg[20][20],x,y;
int main(void)
{
	int n,i;
	while(1){
		scanf("%d%d",&a,&b);
		if(a==0&&b==0) break;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d%d",&x,&y);
			flg[x][y]=1;
		}
		cnt=0;
		func(1,1);
		printf("%d\n",cnt);
	}
	return 0;
}
int func(int x1,int y1){
	if(x1==a&&y1==b) cnt++;
	else if(x1<=a&&y1<=b){
		if(flg[x1+1][y1]!=1&&x1+1<=a) func(x1+1,y1);
		if(flg[x1][y1+1]!=1&&y1+1<=b) func(x1,y1+1);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'func' was not declared in this scope
   15 |                 func(1,1);
      |                 ^~~~
a.cc: In function 'int func(int, int)':
a.cc:26:1: warning: no return statement in function returning non-void [-Wreturn-type]
   26 | }
      | ^
Language: C++

#include<stdio.h>
int a,b,cnt,flg[20][20],x,y;
int main(void)
{
	int n,i,j;
	while(1){
		scanf("%d%d",&a,&b);
		if(a==0&&b==0) break;
		scanf("%d",&n);
		for(i=0;i<a;i++){
			for(j=0;j<b;j++) flg[i][j]=0;
		}
		for(i=0;i<n;i++){
			scanf("%d%d",&x,&y);
			flg[x][y]=1;
		}
		cnt=0;
		func(1,1);
		printf("%d\n",cnt);
	}
	return 0;
}
int func(int x1,int y1){
	// printf("x1=%d y1=%d\n",x1,y1);
	if(x1==a&&y1==b) cnt++;
	else if(x1<=a&&y1<=b){
		if(flg[x1+1][y1]!=1&&x1+1<=a) func(x1+1,y1);
		if(flg[x1][y1+1]!=1&&y1+1<=b) func(x1,y1+1);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'func' was not declared in this scope
   18 |                 func(1,1);
      |                 ^~~~
a.cc: In function 'int func(int, int)':
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
Language: C++

#include<stdio.h>
int a,b,cnt,flg[50][50],x,y;
int main(void)
{
	int n,i,j;
	while(1){
		scanf("%d%d",&a,&b);
		if(a==0&&b==0) break;
		scanf("%d",&n);
		for(i=0;i<a;i++){
			for(j=0;j<b;j++) flg[i][j]=0;
		}
		for(i=0;i<n;i++){
			scanf("%d%d",&x,&y);
			flg[x][y]=1;
		}
		cnt=0;
		func(1,1);
		printf("%d\n",cnt);
	}
	return 0;
}
int func(int x1,int y1){
	// printf("x1=%d y1=%d\n",x1,y1);
	if(x1==a&&y1==b) cnt++;
	else if(x1<=a&&y1<=b){
		if(flg[x1+1][y1]!=1&&x1+1<=a) func(x1+1,y1);
		if(flg[x1][y1+1]!=1&&y1+1<=b) func(x1,y1+1);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'func' was not declared in this scope
   18 |                 func(1,1);
      |                 ^~~~
a.cc: In function 'int func(int, int)':
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
Language: C++

#include <iostream>
#include <vector>

int main(){
	int a,b;
	while(std::cin >> a >> b){
		if(a==0&&b==0) break;

		std::cin >> int n;
		std::vector<std::vector<int>> map(a,vector<int>(b,1)); //地図

		for(int i=0;i<n;++i){
			std::cin >> int x >> int y;
			map[x][y]=0;
		}

		for(int i=1;i<a;++i){
			for(int j=1;j<b;++j){
				if(map[i][j]>0){
					map[i][j] = map[i-1][j]+map[i][j-1];
				}
			}
		}
		std::cout << map[a][b] << std::endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected primary-expression before 'int'
    9 |                 std::cin >> int n;
      |                             ^~~
a.cc:10:53: error: 'vector' was not declared in this scope
   10 |                 std::vector<std::vector<int>> map(a,vector<int>(b,1)); //地図
      |                                                     ^~~~~~
a.cc:10:53: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:10:60: error: expected primary-expression before 'int'
   10 |                 std::vector<std::vector<int>> map(a,vector<int>(b,1)); //地図
      |                                                            ^~~
a.cc:12:31: error: 'n' was not declared in this scope
   12 |                 for(int i=0;i<n;++i){
      |                               ^
a.cc:13:37: error: expected primary-expression before 'int'
   13 |                         std::cin >> int x >> int y;
      |                                     ^~~
a.cc:14:29: error: 'x' was not declared in this scope
   14 |                         map[x][y]=0;
      |                             ^
a.cc:14:32: error: 'y' was not declared in this scope
   14 |                         map[x][y]=0;
      |                                ^
Language: C++

#include <iostream>
#include <vector>

int main(){
	int a,b;
	while(std::cin >> a >> b){
		if(a==0&&b==0) break;

		std::cin >> int n;
		std::vector<std::vector<int>> map(a,std::vector<int>(b,1)); //地図

		for(int i=0;i<n;++i){
			std::cin >> int x >> int y;
			map[x][y]=0;
		}

		for(int i=1;i<a;++i){
			for(int j=1;j<b;++j){
				if(map[i][j]>0){
					map[i][j] = map[i-1][j]+map[i][j-1];
				}
			}
		}
		std::cout << map[a][b] << std::endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected primary-expression before 'int'
    9 |                 std::cin >> int n;
      |                             ^~~
a.cc:12:31: error: 'n' was not declared in this scope
   12 |                 for(int i=0;i<n;++i){
      |                               ^
a.cc:13:37: error: expected primary-expression before 'int'
   13 |                         std::cin >> int x >> int y;
      |                                     ^~~
a.cc:14:29: error: 'x' was not declared in this scope
   14 |                         map[x][y]=0;
      |                             ^
a.cc:14:32: error: 'y' was not declared in this scope
   14 |                         map[x][y]=0;
      |                                ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int n;
int d;
int e;
int f;
int g;
while(cin >>a){
cin >> b;
if(a==0){break;}
cin >> n;
int c[a][b];
d=0;
while(d<a){
g=0;
while(g<b){
c[d][g]=-1;
g=g+1;}
d=d+1;}
d=0;
while(d<n){
cin >>e;
cin >>f;
c[e-1][f-1]=0;
d=d+1;}
c[0][0]=1;
d=1;
while(d<a){
if(c[d][0]!=0){c[d][0]=c[d-1][0]}
d=d+1;}
d=1;
while(d<b){
if(c[0][d]!=0){c[0][d]=c[0][d-1]}
d=d+1;}
d=1;
while(d<a){
g=1;
while(g<b){
if(c[d][g]!=0){c[d][g]=c[d-1][g]+c[d][g-1];}
g=g+1;}
d=d+1;}
cout <<c[a-1][b-1]<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:33: error: expected ';' before '}' token
   33 | if(c[d][0]!=0){c[d][0]=c[d-1][0]}
      |                                 ^
      |                                 ;
a.cc:37:33: error: expected ';' before '}' token
   37 | if(c[0][d]!=0){c[0][d]=c[0][d-1]}
      |                                 ^
      |                                 ;
Language: C++

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

int main(){
    int a,b;
    int cnt=0;
    intm[16]={0};
    while(scanf("%d%d",&a,&b),a,b){
        int ro[32][32]={{0}};
        ro[0][1]=1;
        int n;
        scanf("%d",&n);
        int x,y;
        for(int i=0;i<n;i++){
            scanf("%d%d",&x,&y);
            ro[y][x]=1;
        }
        for(int i=1;i<=b;i++){
            for(int j=1;j<=a;j++){
                if(ro[i][j]==1)ro[i][j]=0;
                else ro[i][j]=(ro[i-1][j]+ro[i][j-1]);
            }
        }
        m[cnt]=ro[b][a];
        cnt++;
    }
    for(int i=0;i<cnt;i++){
        printf("%d\n",m[i]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'intm' was not declared in this scope; did you mean 'int'?
    8 |     intm[16]={0};
      |     ^~~~
      |     int
a.cc:25:9: error: 'm' was not declared in this scope
   25 |         m[cnt]=ro[b][a];
      |         ^
a.cc:29:23: error: 'm' was not declared in this scope
   29 |         printf("%d\n",m[i]);
      |                       ^
Language: C++

#include<iostream>
using namespace std;

int main(){
whie(1){
	int a,b,n,x,y,dp[18][18];
	bool c[18][18];
	for(int i=0;i<18;i++)for(int j=0;j<18;j++){dp[i][j]=0; c[i][j]=true;}
	scanf("%d%d",&a,&b);
if(a==0&&b==0)break;
scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d",&x,&y);
		c[x][y]=false;
	}
	dp[1][1]=1;
	for(int i=1;i<a+1;i++)for(int j=1;j<b+1;j++){
		if(c[i][j]&&!(i==1&&j==1)){
			dp[i][j]=dp[i-1][j]+dp[i][j-1];
		}
	}
	printf("%d\n",dp[a][b]);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'whie' was not declared in this scope
    5 | whie(1){
      | ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,b;
	while(cin>>a>>b,a) 
	{
		int dp[b+1][a+1];
		memset(dp,0,sizeof(dp));
		dp[1][1]=1;
		int n; cin>>n;
		bool flag[b+1][a+1];
		memset(flag,0,sizeof(flag));
		for(int i = 0; i < n; ++i)
		{
			int s,t; cin>>s>>t;
			flag[t][s]=true;
		}

		for(int i = 1; i <= b; ++i)
		{
			for(int j = 1; j <= a; ++j)
			{
				if(flag[i][j]) continue;
				if(0<=i-1) dp[i][j]+=dp[i-1][j];
				if(0<=j-1) dp[i][j]+=dp[i][j-1];
			}	
		}
		cout<<dp[b][a]<<endl;
	}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'memset' was not declared in this scope
   10 |                 memset(dp,0,sizeof(dp));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int FindRoad(const vector<vector<int> >& road, int x, int y);

int h,w;
int n;
int dummy = 0;
int result = 0;

int main(void) {
  int x,y;
  vector<vector<int> > road(18,vector<int>(18));
  cin >> w >> h;
  while(w != 0 && h != 0) {
    cin >> n;
    for(int i = 0; i < n; i++) {
      cin >> x >> y;
      road[x][y] = 1;
    }
    cout << FindRoad(road,1,1) << endl;
    for(int x = 0; x < 18; x++) {
      for(int y = 0; y < 18; y++) {
        if(road[x][y] == 1)
          road[x][y] = 0;
      }
    }
    result = 0;
    cin >> w >> h;
  }
  return 0;
}

int FindRoad(const vector<vector<int> >& road, int x, int y) {
  if( (x - 1 == w || y - 1 == h) || road[x][y] == 1) return 0;
  if( x == w && y == h) { result++; return; }
  dummy = FindRoad( road, x, y + 1);
  dummy = FindRoad( road, x + 1, y);
  return result;
}

Compiler output:
a.cc: In function 'int FindRoad(const std::vector<std::vector<int> >&, int, int)':
a.cc:39:37: error: return-statement with no value, in function returning 'int' [-fpermissive]
   39 |   if( x == w && y == h) { result++; return; }
      |                                     ^~~~~~
Language: C++

/* AOJ 0515 School Road */

#include <iostream>

using namespace std;

const int MAX_A = 16;
const int MAX_B = 16;

int n_routes[MAX_A + 1][MAX_B + 1];
bool closed[MAX_A + 1][MAX_B + 1];

int a, b;

void setup();
void solve();

int
main()
{
    for (;;) {
        cin >> a >> b;
        if (a == 0 && b == 0) break;

        setup();
        solve();
    }

    return 0;
}

void
setup()
{
    int n_closed;

    memset(n_routes, 0, sizeof n_routes);
    memset(closed, 0, sizeof closed);

    cin >> n_closed;
    while (n_closed--) {
        int i, j;

        cin >> i >> j;
        closed[i][j] = true;
    }
}

void
solve()
{
    int i, j;

    for (i = 1; i <= a; i++) {
        for (j = 1; j <= b; j++) {
            if (i == 1 && j == 1) {
                n_routes[i][j] = 1;
                continue;
            }

            if (closed[i][j]) continue;

            n_routes[i][j] = n_routes[i - 1][j] + n_routes[i][j - 1];
        }
    }

    cout << n_routes[a][b] << endl;
}

Compiler output:
a.cc: In function 'void setup()':
a.cc:37:5: error: 'memset' was not declared in this scope
   37 |     memset(n_routes, 0, sizeof n_routes);
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<iostream>
#include<queue>
#include<map>
using namespace std;
int mas[1000][1000];
int x[2]={1,0},y[2]={0,1};
typedef pair<int,int>P;
int road(int,int);
int main(){
  int h,w,cnt,n,x,y;
  while(1){
    cin >> h >> w;
    if(h==0 && w==0){
      break;
    }
    cin >> n;

    memset(mas,0,sizeof(mas));
    
    for(int i=0;i<n;i++){
      cin >> y >> x;
      mas[y][x]=56;
    }
    
    mas[h-1][w-1]=100;
    cnt=road(h,w);
    cnt++;
    cout << cnt << endl;
  }
}

int road(int h,int w){
  queue<P>que;
  int cnt=0;
  que.push(P(0,0));
  while(!que.empty()){
    P p=que.front();
    que.pop();
    //if(
    for(int i=0;i<2;i++){
      int H = p.first+x[i];
      int W = p.second+y[i];
      if(H>=0 && H<h && W>=0 && W<w && mas[H][W]==0){
	que.push(P(H,W));
      }
      if(mas[H][W]==100){
	cnt++;
      }
    }
  }
  return (cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'memset' was not declared in this scope
   18 |     memset(mas,0,sizeof(mas));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<map>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++


#include<iostream>
using namespace std;

int construct[17][17], dp[17][17], W, H, N;
int main()
{
loop:
  cin >> W >> H;
  if(!W 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ')' at end of input
   10 |   if(!W
      |     ~  ^
      |        )
a.cc:10:8: error: expected statement at end of input
a.cc:10:8: error: expected '}' at end of input
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

import java.util.Scanner;
public class Main{
	public static void main(String[] args) { 
		Scanner sc = new Scanner(System.in);
		//while(true){
			int w = sc.nextInt();
			int h = sc.nextInt();
			//if(w==0&&h==0)break;
			int n = sc.nextInt();
			
			boolean map[][]=new boolean[w+1][h+1];
			for(int i=0;i<n;i++)map[sc.nextInt()][sc.nextInt()]=true;
			
			
			//今いる場所を記録
			int dp[][]=new int[w+1][h+1];
			//for(int i=2;i<=w;i++)dp[i][1]=1;
			//for(int i=2;i<=h;i++)dp[1][i]=1;
			dp[1][1]=1;
			for(int i=1;i<=w;i++){
				for(int j=1;j<=h;j++){
//					if(map[i][j])
//						dp[i][j]=0;
					
					
					if(map[i][j]){
						dp[i][j]=0;
					}else if(i==1&&j==1){
						dp[i][j]=1;
					}else if(i==1){
						dp[i][j]=dp[i][j-1];
					}else if(j==1){
						dp[i][j]=dp[i-1][j];
					}else{
						dp[i][j]=dp[i][j-1]+dp[i-1][j];
					}
					
					//System.out.println(i+""+j+" "+dp[i][j-1]+" "+dp[i-1][j]+" "+dp[i][j]);
				}
			}
			System.out.println(dp[w][h]);
		}
	//}
}

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:2:1: error: expected unqualified-id before 'public'
    2 | public class Main{
      | ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
//#include <fstream>

int count_course(const u_int a, const u_int b, const std::map<u_int, std::vector<u_int>> &point)
{
    auto it = point.find(a);
    if(it != point.end()){
        std::vector<u_int> vec = it -> second;
        if((std::find(vec.begin(), vec.end(), b)) != vec.end()){
            return 0;
        }
    }
    if(a == 1 && b == 1){
        return 1;
    }
    else if(a == 1){
        return count_course(a, b - 1, point);
    }
    else if(b == 1){
        return count_course(a - 1, b, point);
    }
    else{
        return count_course(a - 1, b, point) + count_course(a, b - 1, point);
    }
}

int main()
{
    u_int a, b, n, x, y;
    //std::ifstream ifs("--.txt");
    while(1){
        u_int m = 0;
        std::cin /*ifs*/ >> a >> b;
        if(a == 0 && b == 0)
            break;
        
        std::map<u_int, std::vector<u_int>> point;
        std::cin /*ifs*/ >> n;
        for(u_int i = 0; i < n; ++i){
            std::cin /*ifs*/ >> x >> y;
            point[x].push_back(y);
        }
  
        m += get_course(a, b, point);
        std::cout << m << std::endl;    
    }
    //ifs.close();

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:14: error: 'get_course' was not declared in this scope; did you mean 'count_course'?
   47 |         m += get_course(a, b, point);
      |              ^~~~~~~~~~
      |              count_course
Language: C++

#include <iostream>
#include <array>
//#include <fstream>

int main()
{
    const u_int max_point = 16;
    u_int a, b, n, x, y;
    std::ifstream ifs("515.txt");
    while(1){
        std::cin /*ifs*/ >> a >> b;
        if(a == 0 && b == 0)
            break;
        
        std::array<std::array<u_int, max_point>, max_point> point, count;
        for(u_int i = 0; i < max_point; ++i){
            count[i].fill(0);
            point[i].fill(0);
        }
        std::cin /*ifs*/ >> n;
        for(u_int i = 0; i < n; ++i){
            std::cin /*ifs*/ >> x >> y;
            point[x - 1][y - 1] = 1;
        }
        
        count[0][0] = 1;
        for(u_int i = 0; i < a; ++i){
            for(u_int j = 0; j < b; ++j){
                if(point[i][j] != 1){
                    if(i ==0 && j == 0){
                        count[i][j] = 1;
                    }
                    else if(i == 0){
                        count[i][j] = count[i][j - 1];
                    }
                    else if(j == 0){
                        count[i][j] = count[i - 1][j];
                    }
                    else{
                        count[i][j] = count[i - 1][j] + count[i][j - 1];
                    }
                }
            }
        }
        std::cout << count[a - 1][b - 1] << std::endl;               
    }
    //ifs.close();

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: variable 'std::ifstream ifs' has initializer but incomplete type
    9 |     std::ifstream ifs("515.txt");
      |                      ^
a.cc:3:1: note: 'std::ifstream' is defined in header '<fstream>'; this is probably fixable by adding '#include <fstream>'
    2 | #include <array>
  +++ |+#include <fstream>
    3 | //#include <fstream>
Language: C++

#include <iostream>
#include <vector>

/*動的計画法で解く*/
int main(){
	//入力1行目
	int a, b;
	std::cin >> a >> b;
	//入力2行目
	int n;
	std::cin >> n;
	//二次元のベクタ用意(a*b) dpはパターン数をいれる 1で初期化しておく（結局上書き）
	std::vector<std::vector<int>　> dp(a, std::vector<int>(b, 1));
	//工事中の点に0をいれる
	int x, y;
	for(int i = 0; i < n; ++i){
		std::cin >> x >> y;
		dp[x - 1][y - 1] = 0;
	}
	//求める処理　現在の点は左の点と下の点を足す
	for(int i = 1; i < a; ++i){
		for(int j = 1; j < b; ++j){
			if(dp[i][j] != 0){
				dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
			}
		}
	}
	std::cout << dp[a - 1][b - 1] << std::endl;
}

Compiler output:
a.cc:13:37: error: extended character 　 is not valid in an identifier
   13 |         std::vector<std::vector<int>　> dp(a, std::vector<int>(b, 1));
      |                                     ^
a.cc: In function 'int main()':
a.cc:13:39: error: template argument 1 is invalid
   13 |         std::vector<std::vector<int>　> dp(a, std::vector<int>(b, 1));
      |                                       ^
a.cc:13:39: error: template argument 2 is invalid
a.cc:13:69: error: expression list treated as compound expression in initializer [-fpermissive]
   13 |         std::vector<std::vector<int>　> dp(a, std::vector<int>(b, 1));
      |                                                                     ^
a.cc:13:52: error: cannot convert 'std::vector<int>' to 'int' in initialization
   13 |         std::vector<std::vector<int>　> dp(a, std::vector<int>(b, 1));
      |                                                    ^~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    std::vector<int>
a.cc:18:19: error: invalid types 'int[int]' for array subscript
   18 |                 dp[x - 1][y - 1] = 0;
      |                   ^
a.cc:23:30: error: invalid types 'int[int]' for array subscript
   23 |                         if(dp[i][j] != 0){
      |                              ^
a.cc:24:35: error: invalid types 'int[int]' for array subscript
   24 |                                 dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      |                                   ^
a.cc:24:46: error: invalid types 'int[int]' for array subscript
   24 |                                 dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      |                                              ^
a.cc:24:61: error: invalid types 'int[int]' for array subscript
   24 |                                 dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      |                                                             ^
a.cc:28:24: error: invalid types 'int[int]' for array subscript
   28 |         std::cout << dp[a - 1][b - 1] << std::endl;
      |                        ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++)
#define ascent(i, a, b) for(int i = a; i < b; i ++)

#define pb push_back

//#define pair<int, int> ii

using namespace std;

int dp[20][20];

int main() {
	int a, b;
	cin >> a >> b;

	int n;
	cin >> n;

	vector<pair<int, int> > acc;
	loop(n) {
		int x, y;
		cin >> x >> y;
		acc.pb(make_pair(x, y));
	}

	memset(dp, 0, sizeof(dp));
	dp[1][1] = 1;

	ascent(x, 1, a+1) {
		ascent(y, 1, b+1) {
			bool flg = true;
			ascent(i, 0, n) {

				if(x == acc[i].first && y == acc[i].second) {
					dp[x][y] = 0;
					flg = !flg;

					break;
				}
			}

			if(flg) {
				if(x == 1 && y == 1) { continue; }
				else if(x == 1) {
					dp[x][y] = dp[x][y-1];
				}
				else if(y == 1) {
					dp[x][y] = dp[x-1][y];
				}
				else {
					dp[x][y] = dp[x-1][y] + dp[x][y-1];
				}
			}
		}
	}

	cout << dp[a][b] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'memset' was not declared in this scope
   34 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <map>
  +++ |+#include <cstring>
    7 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++)
#define ascent(i, a, b) for(int i = a; i < b; i ++)

#define pb push_back

//#define pair<int, int> ii

using namespace std;

int dp[200][200];

int main() {
	int a, b;
	cin >> a >> b;

	int n;
	cin >> n;

	vector<pair<int, int> > acc;
	loop(n) {
		int x, y;
		cin >> x >> y;
		acc.pb(make_pair(x, y));
	}

	memset(dp, 0, sizeof(dp));
	dp[1][1] = 1;

	ascent(x, 1, a+1) {
		ascent(y, 1, b+1) {
			bool flg = true;
			ascent(i, 0, n) {
				if(x == acc[i].first && y == acc[i].second) {
					dp[x][y] = 0;
					flg = !flg;

					break;
				}
			}

			if(flg) {
				if(x == 1 && y == 1) { continue; }
				else if(x == 1) {
					dp[x][y] = dp[x][y-1];
				}
				else if(y == 1) {
					dp[x][y] = dp[x-1][y];
				}
				else {
					dp[x][y] = dp[x-1][y] + dp[x][y-1];
				}
			}
		}
	}

	cout << dp[a][b] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'memset' was not declared in this scope
   34 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <map>
  +++ |+#include <cstring>
    7 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++)
#define ascent(i, a, b) for(int i = a; i < b; i ++)

#define pb push_back

using namespace std;

int dp[200][200];

int main() {
	int a, b;
	cin >> a >> b;

	int n;
	cin >> n;

	vector<pair<int, int> > acc;
	loop(n) {
		int x, y;
		cin >> x >> y;
		acc.pb(make_pair(x, y));
	}

	memset(dp, 0, sizeof(dp));
	dp[1][1] = 1;

	ascent(x, 1, a+1) {
		ascent(y, 1, b+1) {
			bool flg = true;
			ascent(i, 0, n) {
				if(x == acc[i].first && y == acc[i].second) {
					dp[x][y] = 0;
					flg = !flg;

					break;
				}
			}

			if(flg) {
				if(x == 1 && y == 1) { continue; }
				else if(x == 1) {
					dp[x][y] = dp[x][y-1];
				}
				else if(y == 1) {
					dp[x][y] = dp[x-1][y];
				}
				else {
					dp[x][y] = dp[x-1][y] + dp[x][y-1];
				}
			}
		}
	}

	cout << dp[a][b] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'memset' was not declared in this scope
   32 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <map>
  +++ |+#include <cstring>
    7 | #include <string>
Language: Java

n,k = map(int,input().split())
a = [int(input()) for i in range(n)]

unko = [0]
for i in range(n):
        unko.append(unko[i]+a[i])
inf = float("inf")*(-1)
mvl = inf
for i in range(n-k+1):
        if unko[i+k]-unko[i] >= mvl:
                mvl = unko[i+k]-unko[i]
print(mvl)


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n,k = map(int,input().split())
^
1 error
Language: Java


public class Main {
	
	public static class BIT {
		int[] dat;
		
		public BIT(int n){
			dat = new int[n + 1];
		}
		
		public void add(int k, int a){ // k : 0-indexed
			for(int i = k + 1; i < dat.length; i += i & -i){
				dat[i] += a;	
			}
		}
		
		public int sum(int s, int t){ // [s, t)
			if(s > 0) return sum(0, t) - sum(0, s);
			
			int ret = 0;
			for(int i = t; i > 0; i -= i & -i) {
				ret += dat[i];
			}
			return ret;
		}
	}
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(true){
			final int n = sc.nextInt();
			final int k = sc.nextInt();
			
			if(n == 0 && k == 0){
				break;
			}
			
			BIT bit = new BIT(n);
			for(int i = 0; i < n; i++){
				bit.add(i, sc.nextInt());
			}
			
			int max = Integer.MIN_VALUE;
			for(int start = 0; start < n - k + 1; start++){
				max = Math.max(max, bit.sum(start, start + k));
				//System.out.println("[" + start + " " + (start + k) + ") = " + bit.sum(start, start + k));
			}
		
		System.out.println(max);
		}
	}
}

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

#include<stdio.h>
#include<iostream>
#include<math.h>
#include<chrono>
#include<string>

using namespace std;






int main() {

	
	int nsize;
	int ksize;
	int a[100000];


	while (true) {
		cin >> nsize >> ksize;
		if (nsize == 0 && ksize == 0)break;
		for (int i = 0; i < nsize; i++) {
			cin >> a[i];
		}
		int maxval;
		int val = 0;
		for (int i = 0; i < ksize; i++) {
			val += a[i];
		}
		maxval = val;

		for (int i = ksize; i < nsize; i++) {
			val -= a[i - ksize];
			val += a[i];
			if (maxval < val) {
				maxval = val;
			}
		}
		cout << maxval << endl;
	}
	






	
	
	//system("pause");
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#include<iostream>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:4: error: illegal character: '#'
#include<chrono>
^
Main.java:5: error: illegal character: '#'
#include<string>
^
Main.java:23: error: not a statement
		cin >> nsize >> ksize;
		             ^
Main.java:26: error: not a statement
			cin >> a[i];
			    ^
Main.java:42: error: not a statement
		cout << maxval << endl;
		               ^
Main.java:14: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:19: error: ']' expected
	int a[100000];
	      ^
11 errors
Language: C

#include<stdio.h>
int main(){
	int n,k;
	int i,j,u[5],v=0;
	int a[100000],sum=0,x=0;
	while(scanf("%d%d",&n,&k),n!=0 && k!=0){
		for(i=0;i<n;i++) scanf("%d",&a[i]);
		for(i=0;i<n-k+1;i++){
			for(j=0;j<k;j++) sum+=a[j]:
			if(sum>w) w=sum;
		}
		u[v]=w,v++;
		sum=0;
	}
	for(i=0;i<v;i++) printf("%d\n",u[i]);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:51: error: expected ';' before ':' token
    9 |                         for(j=0;j<k;j++) sum+=a[j]:
      |                                                   ^
      |                                                   ;
main.c:12:22: error: 'w' undeclared (first use in this function)
   12 |                 u[v]=w,v++;
      |                      ^
main.c:12:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int n,k;
	int i,j,u[5],v=0;
	int a[100000],sum=0,x=0;
	while(scanf("%d%d",&n,&k),n!=0 && k!=0){
		for(i=0;i<n;i++) scanf("%d",&a[i]);
		for(i=0;i<n-k+1;i++){
			for(j=0;j<k;j++) sum+=a[j]:
			if(sum>w) w=sum;
			sum=0;
		}
		u[v]=w,v++;
	}
	for(i=0;i<v;i++) printf("%d\n",u[i]);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:51: error: expected ';' before ':' token
    9 |                         for(j=0;j<k;j++) sum+=a[j]:
      |                                                   ^
      |                                                   ;
main.c:13:22: error: 'w' undeclared (first use in this function)
   13 |                 u[v]=w,v++;
      |                      ^
main.c:13:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main()
{
    int n,k,i,sum,max;
    int a[100000];

    while(scanf("%d%d",&n,&k),n+k){

        max=0;
        for(i=0;i<n;i++) scanf("%d",&a[i]);

        for(i=0;i<n-k;i++){
            sum=0;
            for(j=i;j<i+k;j++){
                sum+=a[j];
                if(max<sum) max=sum;
            }   
        }   

        printf("%d\n",max);
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: 'j' undeclared (first use in this function)
   15 |             for(j=i;j<i+k;j++){
      |                 ^
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define INFILE "input.txt"
#define???OUTFILE "output.txt"

signed int a[100000],ans;
unsigned int n,k;
FILE*fp,*fq;

void solve(void){
	int i,diff;
	ans = 0;
	for(i = 0;i < k;i++)ans += a[i];
	diff = 0;
	while(i < n){
		diff += a[i];
		diff -= a[i - k];
		if(diff > 0){
			ans += diff;
			diff = 0;
		}
		i++;
	}
	return;
}

int inp(void){
	int i;
	fscanf("%d%d",&n,&k);
	if(!n)return 0;
	for(i = 0;i < n;i++)scanf("%d",a+i);
	return 1;
}

void oup(void){
	fprintf(fq,"%d\n",ans);
	return;
}

int main(void){
	fp = fopen(INFILE,"r");
	fq = fopen(OUTFILE,"w");
	while(inp()){
		solve();
		oup();
	}
	fclose(fp);
	fclose(fq);
	return 0;
}

Compiler output:
main.c:4:8: error: macro names must be identifiers
    4 | #define???OUTFILE "output.txt"
      |        ^
main.c: In function 'inp':
main.c:29:16: error: passing argument 1 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |         fscanf("%d%d",&n,&k);
      |                ^~~~~~
      |                |
      |                char *
In file included from main.c:1:
/usr/include/stdio.h:422:37: note: expected 'FILE *' but argument is of type 'char *'
  422 | extern int fscanf (FILE *__restrict __stream,
      |                    ~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:29:23: error: passing argument 2 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |         fscanf("%d%d",&n,&k);
      |                       ^~
      |                       |
      |                       unsigned int *
/usr/include/stdio.h:423:43: note: expected 'const char *' but argument is of type 'unsigned int *'
  423 |                    const char *__restrict __format, ...) __wur __nonnull ((1));
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c: In function 'main':
main.c:42:20: error: 'OUTFILE' undeclared (first use in this function); did you mean 'FILE'?
   42 |         fq = fopen(OUTFILE,"w");
      |                    ^~~~~~~
      |                    FILE
main.c:42:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#define INFILE "input.txt"
#define???OUTFILEPYON "output.txt"

signed int a[100000],ans;
unsigned int n,k;
FILE*fp,*fq;

void solve(void){
	int i,diff;
	ans = 0;
	for(i = 0;i < k;i++)ans += a[i];
	diff = 0;
	while(i < n){
		diff += a[i];
		diff -= a[i - k];
		if(diff > 0){
			ans += diff;
			diff = 0;
		}
		i++;
	}
	return;
}

int inp(void){
	int i;
	fscanf("%d%d",&n,&k);
	if(!n)return 0;
	for(i = 0;i < n;i++)scanf("%d",a+i);
	return 1;
}

void oup(void){
	fprintf(fq,"%d\n",ans);
	return;
}

int main(void){
	fp = fopen(INFILE,"r");
	fq = fopen(OUTFILEPYON,"w");
	while(inp()){
		solve();
		oup();
	}
	fclose(fp);
	fclose(fq);
	return 0;
}

Compiler output:
main.c:4:8: error: macro names must be identifiers
    4 | #define???OUTFILEPYON "output.txt"
      |        ^
main.c: In function 'inp':
main.c:29:16: error: passing argument 1 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |         fscanf("%d%d",&n,&k);
      |                ^~~~~~
      |                |
      |                char *
In file included from main.c:1:
/usr/include/stdio.h:422:37: note: expected 'FILE *' but argument is of type 'char *'
  422 | extern int fscanf (FILE *__restrict __stream,
      |                    ~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:29:23: error: passing argument 2 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |         fscanf("%d%d",&n,&k);
      |                       ^~
      |                       |
      |                       unsigned int *
/usr/include/stdio.h:423:43: note: expected 'const char *' but argument is of type 'unsigned int *'
  423 |                    const char *__restrict __format, ...) __wur __nonnull ((1));
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c: In function 'main':
main.c:42:20: error: 'OUTFILEPYON' undeclared (first use in this function)
   42 |         fq = fopen(OUTFILEPYON,"w");
      |                    ^~~~~~~~~~~
main.c:42:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int c[100000],d[100000]
int main(){
	int a,b,e,i,j;
	while(1){
	scanf("%d %d",&a,&b);
		if(a==0&&b==0){
			return 0;
		}
	for(i=0;i<a;i++){
		scanf("%d",&c[i]);
	}
	for(i=0;i<a-b+1;i++){
		d[i]=0;
		for(j=i;j<b+i;j++){
			d[i]+=c[j];
		}
	}
	for(i=0;i<a-b+1;i++){
		for(j=0;j<a-b-1;j++){
			if(c[j]<=c[j+1]){
				e=d[j];
				d[j]=d[j+1];
				d[j+1]=e;
			}
		}
	}
	printf("%d\n",d[0]);
	}
	return 0;
}

Compiler output:
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    3 | int main(){
      | ^~~
Language: C

#include<stdio.h>
int solve(void){
int a,i,k,n,kei=0,ans=-1000000000;
static int wa[100001]={0};
scanf("%d %d",&n,&k);
if(n==0){return 1;}
for(i=1;i<=N;i++){
scanf("%d",&a);
kei+=a;
wa[i]=kei;
}
for(i=0;i<=n-k;i++){
a=wa[i+k]-wa[i];
if(ans<a){ans=a;}
}
printf("%d\n",ans);
return 0;
}
int main(void){
while(solve()==0){}
return 0;
}

Compiler output:
main.c: In function 'solve':
main.c:7:12: error: 'N' undeclared (first use in this function)
    7 | for(i=1;i<=N;i++){
      |            ^
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define rep(i,j,k) for(i = j;i <= k;i++)

int main(){
  int n,k,a[100000],max,temp;

  while(1){
    int i,j;
    scanf("%d%d",&n,&k);
    rep(i,0,n-1){
      scanf("%d",&a[i]);
    }
    
    max = 0;
    temp = 0;
    rep(i,0,k-1){
        max += a[i]
     }
    
    rep(i,1,n-k){
      rep(j,i,i+k-1){
        temp += a[j];
      }
      
      if(max < temp) max = temp;
    }

    printf("%d\n",max);

  }
    
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:20: error: expected ';' before '}' token
   17 |         max += a[i]
      |                    ^
      |                    ;
   18 |      }
      |      ~
Language: C

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

int i,j;
__int64 n,k,a[100005],x,ans;
int comp(const void *p,const void *q){
	return *(int *)p-*(int *)q;
}

int main(){
	scanf("%lld %lld",&n,&k);
	while(n!=0 && k!=0){
		a[0]=0,a[1]=0;
		for(i=1;i<=n;i++){
			scanf("%lld",&x);
			a[i]+=x;
			if(i<n)a[i+1]=a[i];
		}
		ans=a[k];
		for(i=k;i<=n;i++)if(a[i]-a[i-k]>ans)ans=a[i]-a[i-k];
		printf("%lld",ans);
		scanf("%lld %lld",&n,&k);
	}
	return 0;
}

Compiler output:
main.c:6:1: error: unknown type name '__int64'; did you mean '__int64_t'?
    6 | __int64 n,k,a[100005],x,ans;
      | ^~~~~~~
      | __int64_t
Language: C

#include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)

int max(int,int);

int main(void){
  int i,n,k,a[100001],sum;
  
  while(scanf("%d %d",&n,&k),n,k){
    sum=0;
    rep(i,n)scanf("%d",&a[i]);
    rep(i,k)sum+=a[i];
    for(i=1;m<k;i++,m++)
      ans=(ans>sum+=a[m]-a[i])?ans:sum+=a[m]-a[i];
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:13: error: 'm' undeclared (first use in this function)
   13 |     for(i=1;m<k;i++,m++)
      |             ^
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:7: error: 'ans' undeclared (first use in this function)
   14 |       ans=(ans>sum+=a[m]-a[i])?ans:sum+=a[m]-a[i];
      |       ^~~
Language: C

#include <iostream>
#include <algorithm>

using namespace std;

int main( void )
{
	int n, k, input[5000];
	while(cin >> n >> k, n | k) {
		int sum = 0;
		for(int i=0; i < n; ++i) {
			cin >> input[i];
			if(i < k) sum += input[i];
		}
		int i, j, ans = sum;
		i = 0; j = k-1;
		while(j < n-1) {
			sum -= input[i++];
			sum += input[++j];
			ans = max(ans, sum);
		}
		cout << ans << endl;
	}
	return 0;
}

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

#include<stdio.h>

int main(){
int n,k,max=0;
int val;
int sumArray[1000003];

scanf("%d %d",&n,&k);

for(int i=0;i<n;i++){
  scanf("%d",&val);
    if(i == 0)sumArray[i]=val;
    else sumArray[i]=sumArray[i-1]+val;
}

max = sumArray[k-1];
for(int i=k;i<n;i++){
  if(sumArray[i]-sumArray[i-k] > max)max=sumArray[i]-sumArray[i-k];
}

printf("%d\",&max);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:8: warning: missing terminating " character
   21 | printf("%d\",&max);
      |        ^
main.c:21:8: error: missing terminating " character
   21 | printf("%d\",&max);
      |        ^~~~~~~~~~~~
main.c:22:1: error: expected expression before 'return'
   22 | return 0;
      | ^~~~~~
main.c:22:10: error: expected ';' before '}' token
   22 | return 0;
      |          ^
      |          ;
   23 | }
      | ~
Language: C

#include <stdio.h>
int main(){
	int n,k,i,max=0;
	int x[100001];
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++)[
	scanf("%d",&x[i]);
}
for(i=0;i<k;i++){
	max+=x[i];
}
	for(i=0;i<n-k;i++){
		if(x[i]<x[i+k]){
			max-=x[i];
			max+=x[i+k];
		}}
		printf("%d\n",max);
		return 0;
		}

Compiler output:
main.c: In function 'main':
main.c:6:25: error: expected expression before '[' token
    6 |         for(i=0;i<n;i++)[
      |                         ^
main.c:7:27: error: expected ';' before '}' token
    7 |         scanf("%d",&x[i]);
      |                           ^
      |                           ;
    8 | }
      | ~                          
main.c: At top level:
main.c:9:1: error: expected identifier or '(' before 'for'
    9 | for(i=0;i<k;i++){
      | ^~~
main.c:9:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    9 | for(i=0;i<k;i++){
      |          ^
main.c:9:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    9 | for(i=0;i<k;i++){
      |              ^~
main.c:12:9: error: expected identifier or '(' before 'for'
   12 |         for(i=0;i<n-k;i++){
      |         ^~~
main.c:12:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for(i=0;i<n-k;i++){
      |                  ^
main.c:12:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   12 |         for(i=0;i<n-k;i++){
      |                        ^~
main.c:17:24: error: expected declaration specifiers or '...' before string constant
   17 |                 printf("%d\n",max);
      |                        ^~~~~~
main.c:17:31: error: unknown type name 'max'
   17 |                 printf("%d\n",max);
      |                               ^~~
main.c:18:17: error: expected identifier or '(' before 'return'
   18 |                 return 0;
      |                 ^~~~~~
main.c:19:17: error: expected identifier or '(' before '}' token
   19 |                 }
      |                 ^
Language: C

#include <stdio.h>

int main(void){
  int c1,c2;
  int i,j,n;
  int ans;
  int max_index;
  int num[100000];

  while(1){
    scanf("%d %d",&c1,&c2);
    if(c1 == 0 && c2 == 0){
      break;
    }

    ans = 0;
    max_index = c1 - c2;
    c1 -=1;

    for(i = 0;i <= c1;i++){
      scanf("%d",num+i);
    }


    for(i = 0;i <= max_index;i++){
      for(j = 1;j < c2;j++){
	num[i] += num[i+j];
      }
      if(num[i] > ans){
	ans = num[i];
	n = i;
      }
    }
    
    printf("%d\n",num+n);  
  }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:37:3: error: expected declaration or statement at end of input
   37 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>

int main(void){
  int c1,c2;
  int i,j,n;
  int ans;
  int max_index;
  int num[100000];

  while(1){

    scanf("%d %d",&c1,&c2);

    if(c1 == 0 && c2 == 0){
      break;
    }

    ans = 0;
    max_index = c1 - c2;
    c1 -=1;

    for(i = 0;i <= c1;i++){
      scanf("%d",num+i);
    }


    for(i = 0;i <= max_index;i++){
      for(j = 1;j < c2;j++){
	num[i] += num[i+j];
      }
      if(num[i] > ans){
	ans = num[i];
      }
    }
    
    printf("%d\n",ans);  
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:1: error: expected declaration or statement at end of input
   39 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int a[100000 + 1];
int s[100000 + 1];

int main() {

	int n, k;
	int i, j, l;
	int sum = 0, asus = 0;

	while (true) {

		memset(s, 0, sizeof(s));
		memset(a, 0, sizeof(a));

		cin >> n >> k;
		if (n == 0 && k == 0) return 0;

		for (i = 0; i < n; ++i) cin >> a[i];

		for (i = 0; i < n-k; ++i) {
			for (j = 0; j < k; ++j) {

				sum += a[i + j];
			}
			asus = max(asus, sum);
			sum = 0;
		}

		cout << asus << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'memset' was not declared in this scope
   18 |                 memset(s, 0, sizeof(s));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#define ini 0
using namespace std;


int rlay[100001];

int main (){

while (1){
memset(rlay, 0,sizeof(rlay));

int n,k,input,ansmax=0;
cin>>n>>k;
if (n==0&&k==0)break;

rlay[0]=ini;
for (int i=1;i<=n;i++){
        cin>>input;
        rlay[i]=input+rlay[i-1];
}

for (int i=n;i-k>0;i--){
        ansmax = max ( rlay[i]-rlay[i-k] ,ansmax );
}

cout<<ansmax<<endl;

}
return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'memset' was not declared in this scope
   13 | memset(rlay, 0,sizeof(rlay));
      | ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #define ini 0
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#define ini 0
using namespace std;


int rlay[100001];

int main (){

while (1){
memset(rlay, 0,sizeof(rlay));

int n,k,input,ansmax=0;
cin>>n>>k;
if (n==0&&k==0)break;

rlay[0]=ini;
for (int i=1;i<=n;i++){
        cin>>input;
        rlay[i]=input+rlay[i-1];
}

for (int i=n;i-k>0;i--){
        ansmax = max ( rlay[i]-rlay[i-k] ,ansmax );
}

cout<<ansmax<<endl;

}
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'memset' was not declared in this scope
   13 | memset(rlay, 0,sizeof(rlay));
      | ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #define ini 0