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

#include<iostream>
using namespace std;

int main(void){

	int n,x,y,b,p;

	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x >> y >> b >> p;
		if(b >= 5 && p >= 2)cout << (x * b + y * p)/10*8 << endl;
		else if(b >= 5){
			if(x * b + y * p > (x * b + y * (p + (2 - p)))/10*8)cout << (x * b + y * (p+(2-p)))/10*8 << endl;
			else cout << x * b + y * p << endl;
		}else if(p >= 2){
			if(x * b + y * p > (x * (b + (5 - b)) + y * p)/10*8)cout << (x * (b + (5 - b)) + y * p)/10*8 << endl;
			else cout << x * b + y * p << endl;
		}else{
			if(x * b + y * p > (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8)cout << (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8) << endl;
			else cout << x * b + y * p << endl;
			
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:141: error: expected ';' before ')' token
   19 |                         if(x * b + y * p > (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8)cout << (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8) << endl;
      |                                                                                                                                             ^
      |                                                                                                                                             ;
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main () {

	int N;
	cin >> N;

	for (int i = 0; i < N; i++){
		int x, y, b, p;
		cin >> x >> y >> b >> p;

		int futsu = x * b + y * p;
		int oome = (x * 5 + y * 2 + x * max(b - 5, 0) + y * max(p - 2, 0) *8/10;

		if (b >= 5 && p >= 2) {
			cout << futsu * 8 / 10 << endl;
		}else if (oome < futsu){
			cout << oome << endl;
		}else {
			cout << futsu << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:88: error: expected ')' before ';' token
   13 |                 int oome = (x * 5 + y * 2 + x * max(b - 5, 0) + y * max(p - 2, 0) *8/10;
      |                            ~                                                           ^
      |                                                                                        )
Language: C++

#include<stdio.h>
int main(){
  int a1,a2,b1,b2,a,b,c,i,day;
  scanf("%d",&day);
  for(i=1;i<=day;i++){
    scanf("%d %d %d %d",&a1,&b1,&a2,&b2);
    a=a1*a2;
    b=b1*b2;
    c=a+b;
    if(a2>=5&&b2>=2){
      d=c*0.8;
    }
    
    printf("%d\n",c);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'd' was not declared in this scope
   11 |       d=c*0.8;
      |       ^
Language: C++

#include<stdio.h>
int main(){
  int A,B,C,D,E,F,G,H,I,J,a1,a2,b1,b2,a,b,c,i,day<=365;
  scanf("%d",&day);
  for(i=1;i<=day;i++){
    scanf("%d %d %d %d",&a1,&b1,&a2,&b2);
    a=a1*a2;
    b=b1*b2;
    c=a+b;
    if(a2>=5&&b2>=2){
      c=c*0.8;
    }
    A=a1*a2;
    B=b1*2;
    D=A+B;
    D=D*0.8;

    F=a1*5;
    G=b1*b2;
    E=F+G;
    E=E*0.8;

    H=a1*5;
    I=b1*2;
    J=H+I;
    J=J*0.8;
        
    if(c>=E&&a2<=4){
      c=E;
    }else if(c>=D&&b2<=1){
      c=D;
    }else if(c>=J&&a2<=4&&b2<=1){
      c=J;
    }    
    printf("%d\n",c);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:50: error: expected initializer before '<=' token
    3 |   int A,B,C,D,E,F,G,H,I,J,a1,a2,b1,b2,a,b,c,i,day<=365;
      |                                                  ^~
a.cc:4:15: error: 'day' was not declared in this scope
    4 |   scanf("%d",&day);
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		double x,y,b,p,suma=0,sumb=0;
		cin>>x>>y>>b>>p;
		suma=x*b+y*p;
		if(b>=5&&p>=2) suma=sum*4/5;
		if(b<5) b=5;
		if(p<2) p=2;
		sumb=(x*b+y*p)*4/5;
		cout<<min(suma,sumb)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:37: error: 'sum' was not declared in this scope; did you mean 'sumb'?
   10 |                 if(b>=5&&p>=2) suma=sum*4/5;
      |                                     ^~~
      |                                     sumb
Language: C++

//AOJ0298.cpp

#include <iostream>
using namespace std;

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

  int h[101], m[101];
  for(int i=0; i<N; i++){
    cin >> h[i] >> m[i];
  }
  h[N] = 24; m[N] = 0;

  int M;
  cin >> M;

  int k[101], g[101];
  for(int j=0; j<M; j++){
  cin >> k[j] >> g[j];
  }
  k[M] = 24; g[M] = 0;

  for(int i=0; j=0; i<N || j<M;){
    if(h[i]==k[j] && m[i]==g[j]){
      cout << h[i] << ':' << m[i]/10 << m[i]%10;
      i++;  j++;
    }
    else if(h[i]<k[j] || (h[i]==k[j] && m[i]<g[j])){
      cout << h[i] << ':' << m[i]/10 << m[i]%10;
      i++;
    }
    else{
      cout << k[j] << ':' << g[j]/10 << g[j]%10;
      j++;
    }

    if(i==N && j==M){
      cout <<endl;
    }
    else{
      cout << ' ';
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: 'j' was not declared in this scope
   25 |   for(int i=0; j=0; i<N || j<M;){
      |                ^
a.cc:25:31: error: expected ')' before ';' token
   25 |   for(int i=0; j=0; i<N || j<M;){
      |      ~                        ^
      |                               )
a.cc:25:32: error: expected primary-expression before ')' token
   25 |   for(int i=0; j=0; i<N || j<M;){
      |                                ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N;
	int x[N],y[N],b[N],p[N];
	for(int i=0;i<N;i++){
		cin>>x[i]>>y[i]>>b[i]>>p[i];
	}
	int all[N];
	for(int i=0;i<N;i++){
		int goke,kgoke;
		if(b[i]>=5&&p[i]>=2){
			goke=(x[i]*b[i]+y[i]*p[i])*0.8;
		}else{
			goke=x[i]*b[i]+y[i]*p[i];
			if(b[i]<5&&p[i]<2){
				kgoke=(x[i]*5+y[i]*2)*0.8;
			}
			if(b[i]<5&&p[i]>=2){
				kgoke=(x[i]*5+y[i]*p[i])*0.8;
			}
			if(b[i]>=5&&p[i]<2){
				kgoke(x[i]*b[i]+y[i]*2)*0.8;
			}
			if(goke>kgoke){
				all[i]=kgoke;
			}else{
				all[i]=goke;
			}
		}
	}
	for(int i=0:i<N;i++;){
		cout<<N[i]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:38: error: 'kgoke' cannot be used as a function
   24 |                                 kgoke(x[i]*b[i]+y[i]*2)*0.8;
      |                                 ~~~~~^~~~~~~~~~~~~~~~~~
a.cc:33:18: error: initializer in range-based 'for' loop
   33 |         for(int i=0:i<N;i++;){
      |                  ^
a.cc:33:24: error: expected ')' before ';' token
   33 |         for(int i=0:i<N;i++;){
      |            ~           ^
      |                        )
a.cc:33:25: error: 'i' was not declared in this scope
   33 |         for(int i=0:i<N;i++;){
      |                         ^
a.cc:33:29: error: expected primary-expression before ')' token
   33 |         for(int i=0:i<N;i++;){
      |                             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N;
	cin>>N;
	
	for(int i=0;i<N;i++){
		int x,y,b,p;
		cin>>x>>y>>b>>p;

		int f1=x*b+y*p;
	
		if(b<5){
			b=5;
		}
		if(p<2){
			p=2;
		}
		
		int f2=(x*b+y*p)*4/5;

		if(f1<f2){
			cout<<f1<<endl;
		???
		else{
			cout<<f2<<endl;
		}

		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected primary-expression before '?' token
   25 |                 ???
      |                 ^
a.cc:25:18: error: expected primary-expression before '?' token
   25 |                 ???
      |                  ^
a.cc:25:19: error: expected primary-expression before '?' token
   25 |                 ???
      |                   ^
a.cc:26:17: error: expected primary-expression before 'else'
   26 |                 else{
      |                 ^~~~
a.cc:25:20: error: expected ':' before 'else'
   25 |                 ???
      |                    ^
      |                    :
   26 |                 else{
      |                 ~~~~
a.cc:26:17: error: expected primary-expression before 'else'
   26 |                 else{
      |                 ^~~~
a.cc:25:20: error: expected ':' before 'else'
   25 |                 ???
      |                    ^
      |                    :
   26 |                 else{
      |                 ~~~~
a.cc:26:17: error: expected primary-expression before 'else'
   26 |                 else{
      |                 ^~~~
a.cc:25:20: error: expected ':' before 'else'
   25 |                 ???
      |                    ^
      |                    :
   26 |                 else{
      |                 ~~~~
a.cc:26:17: error: expected primary-expression before 'else'
   26 |                 else{
      |                 ^~~~
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:8:29: note: to match this '{'
    8 |         for(int i=0;i<N;i++){
      |                             ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

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

 for(int i=0;i<N;i++){
	int x,y,b,p;
	cin>>x>>y>>b>>p;

	int f1=x*b+y*p;

	if(b<5){
		b=5;
	}
	if(p<2){
		p=2;
	int f2=(x*b+y*p)*4/5;

	if(f1<f2){
		cout<<f1<<endl;
	}
	else{
		cout<<f2<<endl;
	}
 }
return 0;
}

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

//AOJ0278

#include <iostream>
using namespace std;

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

  for(int i=0; i<N; i++){
    int x, y, b, p;
    cin >> x >> y >> b >> p;

    int f1 = x*b + y*p;

    if(b<5){
      b = 5;
    }
    if(p<2){
      p = 2;
    }
    int f2 = (x*b + y*p)*4/5

    if(f1<f2){
      cout << f1 << endl;
    }
    else{
      cout << f2 << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: expected ',' or ';' before 'if'
   24 |     if(f1<f2){
      |     ^~
a.cc:27:5: error: 'else' without a previous 'if'
   27 |     else{
      |     ^~~~
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();
        while (n-- > 0) {
            int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),d=sc.nextInt();
            if(c>=5&&d>=2) {
                System.out.println((a*c+b*d)*8/10);
            }else {
                System.out.println(Math.min(a*c+b*d,(a*(c<5?5:c)+b*(d<2?2:d))*8/10 ));
            }
        }
    }
}



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;

int main(){
    
    int a,b,c,d,e,f;
    cin >> a;
    for (int i =0;i<a;i++){
         cin>>b>>c>>d>>e;
         f = b*d+c*e;
         if(d>=5 && e >=2) {
         cout <<(int)f*0.8<<endl;
         } else if {
         cout <<f<<endl;
         }
    }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected '(' before '{' token
   13 |          } else if {
      |                    ^
      |                    (
Language: C++

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

int main(){
    
    int a,b,c,d,e,f;
    cin >> a;
    for (int i =0;i<a;i++){
         cin>>b>>c>>d>>e;
         f = b*d+c*e;
         if(d>=5 && e >=2){
         cout <<(int)f*0.8<<endl;
         } else if{
         cout <<f<<endl;
         }
    }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected '(' before '{' token
   13 |          } else if{
      |                   ^
      |                   (
Language: C++

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

int main(){
    
    int a,b,c,d,e,f;
    cin >> a;
    for (int i =0;i<a;i++){
         cin>>b>>c>>d>>e;
         f = b*d+c*e;
         if(d>=5 && e >=2)  cout <<   (int)f*0.8<<endl;
         } else cout <<f<<endl;
         
    }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'else' without a previous 'if'
   12 |          } else cout <<f<<endl;
      |            ^~~~
a.cc: At global scope:
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

int main(){
    
    int a,b,c,d,e,f,g;
    cin >> a;
    for (int i =0;i<a;i++){
         cin>>b>>c>>d>>e;
         f = b*d+c*e;
         if (d>=5 && e >=2) {
         g = (int)f*0.8;
         cout << g << endl;
         } else if {
         cout << f << endl;
         }
    }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected '(' before '{' token
   14 |          } else if {
      |                    ^
      |                    (
Language: C++

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

int main(){
    
    int a,b,c,d,e,f,g;
    cin >> a;
    for (int i =0;i<a;i++){
         cin>>b>>c>>d>>e;
         f = b*d+c*e;
         if (d>=5 && e >=2) {
         g = (int)f*0.8;
         cout << g << endl;
         } else if (){
         cout << f << endl;
         }
    }
  
}


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

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

int main() {
  int N;
  int x, y, b, p;
  
  cin >> N;
  
  for(int i=0; i<N; i++) {
    cin >> x >> y >> b >> p;
    if(b >= 5 && p>=2) {
      int a = x*5*0.8 + y*2*0.8;
      cout << a << endl;
    }
    else {
      if(x*max(5,b)*0.8 + y*m#include <iostream>
#include <cmath>
using namespace std;

int main() {
  int N;
  int x, y, b, p;
  
  cin >> N;
  
  for(int i=0; i<N; i++) {
    cin >> x >> y >> b >> p;
    if(b >= 5 && p>=2) {
      int a = x*5*0.8 + y*2*0.8;
      cout << a << endl;
    }
    else {
      if(x*max(5,b)*0.8 + y*max(2,p)*0.8 < x*b + y*p) cout << x*max(5,b)*0.8 + y*max(2,p)*0.8 << endl;
      else cout << x*b + y*p << endl;
    }
  }
  
  return 0;
}
ax(2,p)*0.8 < x*b + y*p) cout << x*max(5,b)*0.8 + y*max(2,p)*0.8 << endl;
      else cout << x*b + y*p << endl;
    }
  }
  
  return 0;
}

Compiler output:
a.cc:18:30: error: stray '#' in program
   18 |       if(x*max(5,b)*0.8 + y*m#include <iostream>
      |                              ^
a.cc: In function 'int main()':
a.cc:18:29: error: 'm' was not declared in this scope
   18 |       if(x*max(5,b)*0.8 + y*m#include <iostream>
      |                             ^
a.cc:22:5: error: condition declares a function
   22 | int main() {
      |     ^~~~
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a;
	scanf("%d",&a);
	for(int i=0;i<a;i++){
		int p,q,r,s;
		scanf("%d%d%d%d",&p,&q,&r,&s);
		if(r>=5&&s>=2)printf("%d\n",4*(p*r+q*s)/5);
		else printf("%d\n",p*r+q*s));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:44: error: expected ';' before ')' token
   11 |                 else printf("%d\n",p*r+q*s));
      |                                            ^
      |                                            ;
Language: C++

include <iostream>
using namespace std;
 
int main() {
	int N = 0;	//入力
	int x, y, b, p; //入力
	int max = 0;	//使うぶんをそのまま買った場合の代金
	int wari = 0;	//割引後の代金
	
	int i = 0;	//カウンタ
 
	cin >> N;
 
	while (1) {
		cin >> x;
		cin >> y;
		cin >> b;
		cin >> p;
 
		max = ((x * b) + (y * p));
 
 
		//購入する券数を割引適用の最低基準まで持ち上げる
		if (b < 5){
			b = 5;
		}
 
		if (p < 2){
			p = 2;
		}
		
		//割引後の代金(または割引を適用する場合の最低額)
		wari = ((x * b) + (y * p)) * 0.8;
		
		//比較
		if (max < wari) {
			cout << max << "\n";
		} else {
			cout << wari << "\n";
		}
 
		i++;		//カウントアップ
 
		if(i == N) {
			return 0;
		}
	}
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> N;
      |         ^~~
a.cc:37:25: error: 'cout' was not declared in this scope
   37 |                         cout << max << "\n";
      |                         ^~~~
a.cc:39:25: error: 'cout' was not declared in this scope
   39 |                         cout << wari << "\n";
      |                         ^~~~
Language: Java

import java.io.*;
import java.math.*;
import java.util.*;

public class Main0279{
	public static void main(String[] args) throws IOException{
		Scanner r = new Scanner(System.in);
		int N;
		int total;
		int zero;
		int flag;
		while(r.hasNext()){
			N = r.nextInt();
			if(N == 0)break;
			int[] gatya = new int[N];
			total = 0;
			zero = 0;
			flag = 0;
			for(int i=0;i<N;i++){
				gatya[i] = r.nextInt();
				if(gatya[i] == 0) zero++;
				if(gatya[i] >= 2) flag=1;
			}
			if(flag == 0) System.out.println("NA");
			else System.out.println(N-zero+1);
		}
	}
}

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

import java.util.Scanner;
class Main1{
 
    public void solve(){
        Scanner sc = new Scanner(System.in);
        int syurui, stok;
        int hairetu[];
        int j = 0;
        syurui = sc.nextInt();
        hairetu = new int[syurui];
        
        for(int i = 0; i < syurui; i++){
			stok = sc.nextInt();
            hairetu[j] = stok;
            j += 1;
        }
		 
        if(stok == 0){
             System.out.print("N#A");
        }else if(syurui == 1){
                 System.out.print(2);
        }else{
              System.out.print(syurui+1);
        }
    }

		
    
    public static void main(String[] args){
        Main obj = new Main1();
        obj.solve();
    }

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

import java.util.Scanner;

public class Main{
    public void solve(){
        Scanner sc =new Scanner(System.in);
        int N,su;
        int one = 0;
        int some = 1;
        N = sc.nextInt();
        
        while(N != 0){
            for(int i=0;i<N;i++){
                su = sc.nextInt();
                if(su <= 1){
                    one++;
                }else{
                    some++;
                }
            }
            if(some >= 2){
                System.out.println(one+some);
            }else{
                System.out.println("NA");
            }
            int one = 0;
            int some = 1;
            N = sc.nextInt();
        }
    }
    
    public static void main(String[]args){
        Main obj = new Main();
        obj.solve();
    }
}

Compiler output:
Main.java:25: error: variable one is already defined in method solve()
            int one = 0;
                ^
Main.java:26: error: variable some is already defined in method solve()
            int some = 1;
                ^
2 errors
Language: Java

import java.util.Scanner;
public class Main4{
	
	public void solve(){
		Scanner sc =new Scanner(System.in);
		while(true){
			int x =sc.nextInt();
			if(x==0)
			break;//ループを抜ける
			int a = 0;
			boolean flag=false;//真偽の変数
			for(int s=0;s<x;s++){
				int r = sc.nextInt();
				if(r>0) a++;
				if(r>1) flag = true;
			}
			if(!flag) System.out.println("NA");
			else System.out.println(a+1);
		}
	}

	public static void main(String[] args){
		Main4 obj = new Main4();
		obj.solve();
	}
}

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

import java.util.Scanner;

public class ACMtest1 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		while(true){
			int n=sc.nextInt();
			if(n==0)break;
			int count = 0,sum =0;
			
			for(int i=0;i<n;i++){
				int data = sc.nextInt();
				if(data==0)count++;
				sum +=data;
			}
			
			if(sum<=2)System.out.println("NA");
			else System.out.println((n+1-count));
			
		}
		
		sc.close();
		
	}

}



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

import java.util.*;
public class pck4 {
    public static void main(String args[]) {
	Scanner scan = new Scanner(System.in);
	int n;
	int[] k = new int[10000]
	while(true) {
	    n = scan.nextInt();
	    if(n == 0) break;
	    for(int i = 0;i < n;i++) {
		k[i] = scan.nextInt();
		if(n == 1) {
		    if(k[i] > 1) {
			System.out.println(2);
		    }
		} else if(n >= 2) {
		    System.out.println(n + 1);
		}
	    }
	}
    }
}

Compiler output:
Main.java:6: error: ';' expected
	int[] k = new int[10000]
	                        ^
1 error
Language: Java

import java.util.*;
public class pck4 {
    public static void main(String args[]) {
	Scanner scan = new Scanner(System.in);
	int n;
	int k = new int[10000]
	while(true) {
	    n = scan.nextInt();
	    if(n == 0) break;
	    for(int i = 0;i < n;i++) {
		k[i] = scan.nextInt();
		if(n == 1) {
		    if(k[i] > 1) {
			System.out.println(2);
		    }
		} else if(n >= 2) {
		    System.out.println(n + 1);
		}
	    }
	}
    }
}

Compiler output:
Main.java:6: error: ';' expected
	int k = new int[10000]
	                      ^
1 error
Language: Java

import java.util.*;
public class pck4 {
    public static void main(String args[]) {
	Scanner scan = new Scanner(System.in);
	int n;
	int [] k = new int[10000]
	while(true) {
	    n = scan.nextInt();
	    if(n == 0) break;
	    for(int i = 0;i < n;i++) {
		k[i] = scan.nextInt();
		if(n == 1) {
		    if(k[i] > 1) {
			System.out.println(2);
		    }
		} else if(n >= 2) {
		    System.out.println(n + 1);
		}
	    }
	}
    }
}

Compiler output:
Main.java:6: error: ';' expected
	int [] k = new int[10000]
	                         ^
1 error
Language: Java

import java.util.*;
public class pck4 {
    public static void main(String args[]) {
	Scanner scan = new Scanner(System.in);
	int n;
	int [] k = new int[10000];
	while(true) {
	    n = scan.nextInt();
	    if(n == 0) break;
	    for(int i = 0;i < n;i++) {
		k[i] = scan.nextInt();
		if(n == 1) {
		    if(k[i] > 1) {
			System.out.println(2);
		    }
		} else if(n >= 2) {
		    System.out.println(n + 1);
		}
	    }
	}
    }
}

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

import java.util.*;
public class Pck4 {
    public static void main(String args[]) {
	Scanner scan = new Scanner(System.in);
	int n;
	int [] k = new int[10000];
	while(true) {
	    n = scan.nextInt();
	    if(n == 0) break;
	    for(int i = 0;i < n;i++) {
		k[i] = scan.nextInt();
		if(n == 1) {
		    if(k[i] > 1) {
			System.out.println(2);
		    }
		} else if(n >= 2) {
		    System.out.println(n + 1);
		}
	    }
	}
    }
}

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

import java.util.*;
public class Main {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int[] k = new int[10000];
	while(ture) {
	    String ok = false;
	    if(n == 0) break;
	    int cnt = 0;
	    for(int i = 0; i < n; i++) {
		k[i] = scan.nextInt();
		if(k[i] >= 1) cnt++;
		if(k[i] >= 2) ok = true;
	    }
	    if(!ok) System.out.println("NA");
	    else System.out.println(cnt +1);
	}
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
	while(ture) {
	      ^
  symbol:   variable ture
  location: class Main
Main.java:8: error: incompatible types: boolean cannot be converted to String
	    String ok = false;
	                ^
Main.java:14: error: incompatible types: boolean cannot be converted to String
		if(k[i] >= 2) ok = true;
		                   ^
Main.java:16: error: bad operand type String for unary operator '!'
	    if(!ok) System.out.println("NA");
	       ^
4 errors
Language: C

#include <stdio.h>

int main(void)
{
	int n;
	int ans;
	int k;
	int i;
	bool f;
	
	while (scanf("%d", &n), n){
		ans = n + 1;
		f = false;
		for (i = 0; i < n; i++){
			scanf("%d", &k);
			if (k == 0){
				ans--;;
			}
			if (k > 1){
				f = true;
			}
		}
		if (f == true){
			printf("%d\n", ans);
		}
		else {
			printf("NA\n");
		}
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: unknown type name 'bool'
    9 |         bool f;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:13:21: error: 'false' undeclared (first use in this function)
   13 |                 f = false;
      |                     ^~~~~
main.c:13:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:37: error: 'true' undeclared (first use in this function)
   20 |                                 f = true;
      |                                     ^~~~
main.c:20:37: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>

int main(void){
	while(1){
		int n, i, ans=0; 
		int count=0;//１個以下しかない商品の種類の数
		int a[10000];
		
		scanf(" %d", &n);
		if(n==0) break;
		for(i=0; i<n; i++) {
			scanf(" %d", &a[i]);
			if(a[i] <=1) count++;
		}
		
		if(count == n) {
			printf("NA\n");
			continue;
		}
		
		for(i=0; i<n; i++) { //１個以下のものを全て出し尽くす
			if(a[i] <=1) {
				ans += a[i];
				a[i] = 0;
			}
		}
		
		ans += n-count+1;

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:38: error: expected ';' before '}' token
   30 |                 printf("%d\n", ans);0
      |                                      ^
      |                                      ;
   31 |         }
      |         ~
Language: C

#include<stdio.h>
int main(void)
{
	int N,i,c;
	int *k,*kk;
	while(1){
		scanf("%d",&N);
		if(N==0) break;
		k = new int [N];
		kk = new int [N];
		for(i=0;i<N;i++)
			kk[i] = 0;
		for(i=0;i<N;i++)
			scanf("%d",&k[i]);
		
		i=0,c=0;
		while(1){
			if(k[i%N] > 0){
				k[i%N]--;
				kk[i%N]++;
				c++;
			}
			if(kk[i%N] == 2){
				printf("%d\n",c);
				break;
			}
			if(i > N * N){
				printf("NA\n");
				break;
			}
			i++;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:21: error: 'new' undeclared (first use in this function)
    9 |                 k = new int [N];
      |                     ^~~
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:24: error: expected ';' before 'int'
    9 |                 k = new int [N];
      |                        ^~~~
      |                        ;
main.c:10:25: error: expected ';' before 'int'
   10 |                 kk = new int [N];
      |                         ^~~~
      |                         ;
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
     int n,k,i,count=0,a[1000][3],j=0;
     while(scanf("%d",&n),n!=0){
          for(i=1;i<=n;i++){
               scanf("%d",&k);
               if(k>=2){
                    count=1;
                    a[j]=i+n;
                    break;
               }
          }
          if(count==0)strcpy(a[j],"NA");
          j++;
     }
     for(i=0;i<j;i++)printf("%d\n",a[j]);
     return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:25: error: assignment to expression with array type
   10 |                     a[j]=i+n;
      |                         ^
main.c:14:31: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
   14 |           if(count==0)strcpy(a[j],"NA");
      |                              ~^~~
      |                               |
      |                               int *
In file included from main.c:2:
/usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'int *'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
Language: C

#include<stdio.h>
int main(void)
{
	int N,k,m,j,t,i;
	scanf("%d",&N);
	while(N!=0){
		m=0;
		j=0;
		for(i=0;i<N;i++){
			scanf("%d",&k);
			if(k<2){
				m=m+1;
				if(k==0){
					j=j+1;
				}
			}
		}		
		if(m==N){
			printf("NA\n");
		}
		else{
			printf(n-j+1);
		}
		scanf("%d\n",&N);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:32: error: 'n' undeclared (first use in this function)
   22 |                         printf(n-j+1);
      |                                ^
main.c:22:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void)
{
	int N,k,m,j,i,;
	scanf("%d",&N);
	while(N!=0){
		m=0;
		j=0;
		for(i=0;i<N;i++){
			scanf("%d",&k);
			if(k<2){
				m=m+1;
				if(k==0){
					j=j+1;
				}
			}
		}		
		if(m==N){
			printf("NA\n");
		}
		else{
			printf("%d",N-j+1);
		}
		scanf("%d",&N);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:23: error: expected identifier or '(' before ';' token
    4 |         int N,k,m,j,i,;
      |                       ^
Language: C

#include<stdio.h>
int main(void)
{
	int N,k,m,j,i;
	scanf("%d",&N);
	while(N!=0){
		m=0;
		j=0;
		for(i=0;i<N;i++){
			scanf("%d",&k);
			if(k<2){
				m=m+1;
				if(k==0){
					j=j+1;
				}
			}
		}		
		if(m==N){
			printf("NA\n");
		}
		else{
			printf("%d\n"N-j+1);
		}
		scanf("%d",&N);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:38: error: expected ')' before 'N'
   22 |                         printf("%d\n"N-j+1);
      |                               ~      ^
      |                                      )
Language: C

f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:3: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:3: error: type of 'r' defaults to 'int' [-Wimplicit-int]
main.c:1:3: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |                      ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |                      ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:39: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |                                       ^~~~~~
main.c:1:39: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:39: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:66: error: expected ')' before 'for'
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |                    ~                                             ^~~
      |                                                                  )
main.c:1:129: error: expected expression before '}' token
    1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
      |                                                                                                                                 ^
Language: C++

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

int main(int argc, char** argv) {
    
    int N;
    int a;
    int i;
    
    while (1) {
        N = 0;
        a = 0;
        cin >> N;
        if (N == 0) {
            return 0;
        }
      
        int *k = new int [N];
        
        for (i = 0; i < N; i++) {
            cin >> k[i];
        }
        
        for (i = 0; i < N; i++) {
            if(k[i]>1) {
            a++;
            }
        }
        
        if (a > 1) {
            cout << "3" << endl;
        }
        else if (a == 1) {
            cout << "2" << endl;
        }
        else {
            cout << "NA" << endl;
        }
        delete[] *k;
     }
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:40:18: error: type 'int' argument given to 'delete', expected pointer
   40 |         delete[] *k;
      |                  ^~
Language: C++

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

int main(int argc, char** argv) {
    
    int N;
    int a, b, c;
    int i;
    
    while (1) {
        N = 0;
        a = 0;
        b = 0;
        c = 0;
        cin >> N;
        if (N == 0) {
            return 0;
        }
      
        int *k = new int [N];
        
        for (i = 0; i < N; i++) {
            cin >> k[i];
        }
        
        for (i = 0; i < N; i++) {
            if(k[i] > 1) {
                a++;  
            }
            if(k[i] == 0) {
                b++;   
            }
            if(k[i] == 0) {
                c++;   
            }
        if (a > 0 && b > 0) {
            cout << "3" << endl;
        }
        else if (a == 1) {
            cout << "2" << endl;
        }
        else {
            cout << "NA" << endl;
        }
        delete[] k;
     }
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:5:33: note: to match this '{'
    5 | int main(int argc, char** argv) {
      |                                 ^
Language: C++

#include <cstdio>
#include <vector>

using namespace std;

int N;

int main(){

    while(1){
start:
        scanf("%d",&N);

        if(N == 0)break;
        vector<int> data;
        bool flag = false;

        for(int i=0;i<N;i++){
            int tmp;
            scanf("%d",&tmp);
            if(tmp > 1) flag = true;
            data.push_back(tmp);
        }
        if(N == 1){
            printf("2\n");
            goto start;
        }
        if(!flag){
            printf("NA\n");
            goto start;
        }
        sort(data.begin(),data.end());

        int ans = 0;

        for(int i=1;i<N;i++)ans += data[i];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   32 |         sort(data.begin(),data.end());
      |         ^~~~
      |         short
Language: C++

#include <cstdio>
#include <vector>

int N;

int main(){

    while(1){
start:
        scanf("%d",&N);

        if(N == 0)break;
        std::vector<int> data;
        bool flag = false;

        for(int i=0;i<N;i++){
            int tmp;
            scanf("%d",&tmp);
            if(tmp > 1) flag = true;
            data.push_back(tmp);
        }
        if(N == 1){
            printf("2\n");
            goto start;
        }
        if(!flag){
            printf("NA\n");
            goto start;
        }
        std::sort(data.begin(),data.end());

        int ans = 0;

        for(int i=1;i<N;i++)ans += data[i];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: 'sort' is not a member of 'std'
   30 |         std::sort(data.begin(),data.end());
      |              ^~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int i,x,w,n,flg
	while(1)	{
		scanf("%d",&n);
		if(n==0)	break;
		w=n;
		for(i=0;i<n;i++){
			scanf("%d",&x);
			if(x==0){
			w=w-1;
			}
			if(x>=2){
			flg=1;
			}
		}
		if(flg==1){
		printf("%d\n",x+1)
		}
		else{
			printf("NA\n");
			}
		}	
	return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'while'
    5 |         while(1)        {
      |         ^~~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int i,x,w,n,flg;
	while(1)	{
	flg=0;
		scanf("%d",&n);
		if(n==0)	break;
		w=n;
		for(i=0;i<n;i++){
			scanf("%d",&x);
			if(x==0){
			w=w-1;
			}
			if(x>=2){
			flg=1;
			}
		}
		if(flg==1){
		printf("%d\n",x+1)
		}
		else{
			printf("NA\n");
			}
		}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: expected ';' before '}' token
   20 |                 printf("%d\n",x+1)
      |                                   ^
      |                                   ;
   21 |                 }
      |                 ~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n=0;
	int i=0;
	int j=0;
	int x=0;
	int g=0;
	int s[10005];
	bool a=false;
	memset(s,0,sizeof(s));
	cin>>n;
	while(n!=0){
		for(i=0;i<n;i++){
			cin>>x;
			if(x>=2){
				a=true;
			}
			if(x!=0){
				g++;
			}
		}
		if(a==false){
			s[j]=1;
		}else{
			s[j]=g+1;
		}
		a=false;
		g=0;
		cin>>n;
		j++;
	}
	i=0;
	while(s[i]!=0){
		if(s[i]==1){
			cout<<"NA"<<endl;
		}else{
			cout<<s[i]<<endl;
		}
		i++;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         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 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<utility>
using namespace std;
int main(){
	int n=0;
	int i=0;
	int j=0;
	int x=0;
	int g=0;
	int s[10005];
	bool a=false;
	memset(s,0,sizeof(s));
	cin>>n;
	while(n!=0){
		for(i=0;i<n;i++){
			cin>>x;
			if(x>=2){
				a=true;
			}
			if(x!=0){
				g++;
			}
		}
		if(a==false){
			s[j]=1;
		}else{
			s[j]=g+1;
		}
		a=false;
		g=0;
		cin>>n;
		j++;
	}
	i=0;
	while(s[i]!=0){
		if(s[i]==1){
			cout<<"NA"<<endl;
		}else{
			cout<<s[i]<<endl;
		}
		i++;
	}
}

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

#include<stdio.h>
int main(void)
{
	int N,k[10000+1],i,bakatoy;
	scanf("%d",&N);
	for(i=1;i<=N;i++){
		scanf("%d",&k[i]);
		bakatoy+=k[i];
	}
	printf("%d",bakatoy-2);
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected '}' at end of input
   11 |         return 0;
      |                  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

/*#include<stdio.h>
int main(){
int i,j,N,x,y,b,p,an,ano,ans[365];
scanf("%d",&N);
for(i=0;i<N;i++){
	scanf("%d%d%d%d",&x,&y,&b,&p);
	an = x*b;
	an+= y*p;
	if(b>4 && p>1){
		ano =x*b+y*p;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	 else if(4<b ){
		ano = x*b + y*2 ;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	else if(1<b){
		ano = x*5 + y*p;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	else if(5>b&&2>p){
		ano = x*5 + y*2;
		ano*=0.8;
		if(ano<an){
			an = ano;
		}
	}	
	ans[i]=an;
}
for(i=0;i<N;i++){
		printf("%d\n",ans[i]);
}
return 0;
}
*/
#include<iostream>
using namespace std;
int main(){
	int N,i,j,k[10000],c=0;
		cin >> N;
	while(N!=0){
	for(i=0;i<N;i++){
		cin >>k[i]
	}
	for(i=0;i<N;i++){
		if(k[i]>=2){
			c++;
		}
	}
	if(c==0){
		printf("NA\n");
	}
	else{
		printf("%d\n",N+1);
	}
	c=0;
	cin >> N;
	}
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:27: error: expected ';' before '}' token
   52 |                 cin >>k[i]
      |                           ^
      |                           ;
   53 |         }
      |         ~                  
a.cc:68:17: error: expected ';' before '}' token
   68 |         return 0
      |                 ^
      |                 ;
   69 | }
      | ~
Language: C++

/*#include<stdio.h>
int main(){
int i,j,N,x,y,b,p,an,ano,ans[365];
scanf("%d",&N);
for(i=0;i<N;i++){
	scanf("%d%d%d%d",&x,&y,&b,&p);
	an = x*b;
	an+= y*p;
	if(b>4 && p>1){
		ano =x*b+y*p;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	 else if(4<b ){
		ano = x*b + y*2 ;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	else if(1<b){
		ano = x*5 + y*p;
		ano*=0.8;
		if(ano < an){
			an = ano;
		}
	}
	else if(5>b&&2>p){
		ano = x*5 + y*2;
		ano*=0.8;
		if(ano<an){
			an = ano;
		}
	}	
	ans[i]=an;
}
for(i=0;i<N;i++){
		printf("%d\n",ans[i]);
}
return 0;
}
*/
#include<iostream>
using namespace std;
int main(){
	int N,i,j,k[10000],c[100000]={0};
	cin >> N;
	while(N!=0){
		for(i=0;i<N;i++){
			cin >>k[i]
		}
		for(i=0;i<N;i++){
			if(k[i]>=2){
				c[j]++;
			}
		}
		if(c[j]==0)
			cout << NA << endl;
		else
			cout << N+1 << endl;
		cin >> N;
	}
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:35: error: expected ';' before '}' token
   52 |                         cin >>k[i]
      |                                   ^
      |                                   ;
   53 |                 }
      |                 ~                  
a.cc:60:33: error: 'NA' was not declared in this scope; did you mean 'N'?
   60 |                         cout << NA << endl;
      |                                 ^~
      |                                 N
a.cc:65:17: error: expected ';' before '}' token
   65 |         return 0
      |                 ^
      |                 ;
   66 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N[10000],i,j=0,k[10000],c[10000]={0};
	cin >> N[j];
	while(N[j]!=0){
		for(i=0;i<N;i++){
			cin >>k[i]
		}
		for(i=0;i<N;i++){
			if(k[i]>=2){
				c[j]++;
			}
		}
		j++;
		cin >> N[j];
	}
	for(i=0;i<j;j+P+){
		if(c[j]==0)
			cout << NA << endl;
		else
			cout << N[j]+1 << endl;
	}
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 for(i=0;i<N;i++){
      |                         ~^~
a.cc:8:35: error: expected ';' before '}' token
    8 |                         cin >>k[i]
      |                                   ^
      |                                   ;
    9 |                 }
      |                 ~                  
a.cc:10:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 for(i=0;i<N;i++){
      |                         ~^~
a.cc:18:23: error: 'P' was not declared in this scope
   18 |         for(i=0;i<j;j+P+){
      |                       ^
a.cc:18:25: error: expected primary-expression before ')' token
   18 |         for(i=0;i<j;j+P+){
      |                         ^
a.cc:20:33: error: 'NA' was not declared in this scope; did you mean 'N'?
   20 |                         cout << NA << endl;
      |                                 ^~
      |                                 N
a.cc:24:17: error: expected ';' before '}' token
   24 |         return 0
      |                 ^
      |                 ;
   25 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  string str;
  int result = 0;

  while (cin >> N) {
    for (int i = 0; i < (int)str.size(); ++i) {
      char ch = str[i];
      if (ch != "") {
        int k = atoi(ch);
        if (k >= 2) {
          result++;
        }
      }
    }
  }

  if (result == 0) {
    cout << "NA" <<endl;
  } else {
    cout << result;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if (ch != "") {
      |           ~~~^~~~~
a.cc:13:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   13 |         int k = atoi(ch);
      |                      ^~
      |                      |
      |                      char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  string str;
  int result = 0;

  while (cin >> N) {
    for (int i = 0; i < (int)str.size(); ++i) {
      char ch = str[i];
      if (ch != ' ') {
        int k = atoi(ch);
        if (k >= 2) {
          result++;
        }
      }
    }
  }

  if (result == 0) {
    cout << "NA" <<endl;
  } else {
    cout << result;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   13 |         int k = atoi(ch);
      |                      ^~
      |                      |
      |                      char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~