criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;

public class MAIN{
	public static void main(String[] args){
		int n;
		Scanner scan = new Scanner(System.in);
		while(true){
			n = scan.nextInt();
			if(n == 0){
				break;
			}
			System.out.println("" + aoj0052(n));
		}
	}
	static int aoj0052(int n){
		int res = 0, m = 0;
		for(int i = n;i / 5 != 0;i/=5){
			m++;
		}
		while(m > 0){
			res += n / (int)Math.pow(5.0, (double)m);
			m--;
		}
		return res;
	}
}

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

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(true){
			int n=sc.nextInt();
			if(n==0){
				break;
			}
			BigInteger fact=new BigInteger("1");
			for(;n>=1;n--){
				fact=fact.multiply(new BigInteger(String.valueOf(n)));
			}
			char[] check=String.valueOf(fact).toCharArray();
			int count=0;
			for(int i=check.length-1;i>=0;i--){
				if(check[i]=='0'){
					count++;
				}else{
					break;
				}
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
			BigInteger fact=new BigInteger("1");
			^
  symbol:   class BigInteger
  location: class Main
Main.java:10: error: cannot find symbol
			BigInteger fact=new BigInteger("1");
			                    ^
  symbol:   class BigInteger
  location: class Main
Main.java:12: error: cannot find symbol
				fact=fact.multiply(new BigInteger(String.valueOf(n)));
				                       ^
  symbol:   class BigInteger
  location: class Main
3 errors
Language: C

main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      | ^~~~
main.c: In function 'main':
main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                    ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
main.c:1:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                    ^~~~~
main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:38: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                      ^~~~~~
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:38: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main(void){
	__int64 n , sum;
	int i;
	while(1){
		sum = 0;
		scanf("%lld" , &n);
		if(n == 0) break;
		for(;n>=5;){
			sum += n / 5;
			n /= 5;
		}
		printf("%d\n" , sum);
	}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    4 |         __int64 n , sum;
      |         ^~~~~~~
      |         __int64_t
Language: C

include<stdio.h>
main(){
  int n;
  while(scanf("%d",&n)!=EOF){
    if(n/4-1<=0){
      printf("0\n");
    }
    else{
      printf("%d\n",n/4-1);
    }
  }
  return 0;
}

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

#include<stdio.h>
int main(void)
{
  int n,i,x,count;

  while(1){
    scanf("%d",&n);
    if(n==0)break;
    count=0
    for(i=5;i<=n;i+=5){
      x=i;
      while(x%5==0){
        count++;
        x/5;
      }
    printf("%d\n",count);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:12: error: expected ';' before 'for'
    9 |     count=0
      |            ^
      |            ;
   10 |     for(i=5;i<=n;i+=5){
      |     ~~~     
main.c:20:1: error: expected declaration or statement at end of input
   20 | }
      | ^
Language: C

#include<stdio.h>
int main(void)
{
  int n,i,x,count;

  while(1){
    scanf("%d",&n);
    if(n==0)break;
    count=0;
    for(i=5;i<=n;i+=5){
      x=i;
      while(x%5==0){
        count++;
        x/5;
      }
    printf("%d\n",count);
  }

  return 0;
}

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

#include<ios>
int n,c;
main()
{
    while(scanf("%d",&n),n)
    {
        c=0;
        while(n>4)c+=n/=5,;
        printf("%d\n",c);
    }
}


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:27: error: expected primary-expression before ';' token
    8 |         while(n>4)c+=n/=5,;
      |                           ^
Language: C++

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <cstdio>
#include <vector>
#include <cstdio>
using namespace std;
#define rep(i,n) for(LL i=0;i<n;i++)
#define all(v)	(v).begin(),(v).end()
#define MOD  1000000007
const int INF = INT_MAX;
typedef long long LL;
int five[20001];
int main(){
	int n;
	
	int i = 5;
	while (i < 20001){
		for (int j = 1; j*i < 20001; j++){
			five[j*i]++;
		}
		i *= 5;
	}
	cout << "passed" << endl;
	while (cin >> n){
		if (n == 0) break;
		int ans = 0;
		for (int j = 1; j <= n; j++){
			ans += five[j];
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc:13:17: error: 'INT_MAX' was not declared in this scope
   13 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <cstdio>
  +++ |+#include <climits>
    9 | using namespace std;
Language: C++

#include <iostream>

int main(){
	int n;
	while(std:cin>>n , n){
		int sum=0, mul=5;
		while(n>=mul){
			sum+=n/mul;
			mul*=5;
		}
		std::cout << sum << std::endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: found ':' in nested-name-specifier, expected '::'
    5 |         while(std:cin>>n , n){
      |                  ^
      |                  ::
Language: C++

using System;

class _0052 {
    public static void Main() {
        int n, sum;

        while ((n = int.Parse(Console.ReadLine())) != 0) {
            sum = 0;
            for (float b = 5; b <= n; b *= 5)
                sum += (int)(n / b);
            Console.WriteLine(sum);
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void Main() {
      |           ^~~~~~~
      |           :
a.cc:14:2: error: expected ';' after class definition
   14 | }
      |  ^
      |  ;
a.cc: In static member function 'static void _0052::Main()':
a.cc:7:21: error: expected primary-expression before 'int'
    7 |         while ((n = int.Parse(Console.ReadLine())) != 0) {
      |                     ^~~
a.cc:7:21: error: expected ')' before 'int'
a.cc:7:16: note: to match this '('
    7 |         while ((n = int.Parse(Console.ReadLine())) != 0) {
      |                ^
a.cc:13:5: error: expected ')' before '}' token
   13 |     }
      |     ^
a.cc:7:15: note: to match this '('
    7 |         while ((n = int.Parse(Console.ReadLine())) != 0) {
      |               ^
a.cc:13:5: error: expected primary-expression before '}' token
   13 |     }
      |     ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    
    int n;
    int x,y;
    for(){
        cin >> n;
        if(n == 0) return 0;
        x = n / 5;
        for(int i=1;i<=x; i++){
            y += i;
        }
        
        cout << y << endl;
        
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected primary-expression before ')' token
    8 |     for(){
      |         ^
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:18:6: error: expected ';' before '}' token
   18 |     }
      |      ^
      |      ;
   19 | 
   20 | }
      | ~     
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:18:6: error: expected ')' before '}' token
   18 |     }
      |      ^
      |      )
   19 | 
   20 | }
      | ~     
a.cc:8:8: note: to match this '('
    8 |     for(){
      |        ^
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    
    int n;
    int x,y;
    for(){
        cin >> n;
        if(n == 0) return 0;
        x = n / 5;
        for(int i=1;i<=x; i++){
            y += i;
        }
        
        cout << y << endl;
        
    }
    
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected primary-expression before ')' token
    8 |     for(){
      |         ^
a.cc:20:5: error: expected primary-expression before 'return'
   20 |     return 0;
      |     ^~~~~~
a.cc:18:6: error: expected ';' before 'return'
   18 |     }
      |      ^
      |      ;
   19 | 
   20 |     return 0;
      |     ~~~~~~
a.cc:20:5: error: expected primary-expression before 'return'
   20 |     return 0;
      |     ^~~~~~
a.cc:18:6: error: expected ')' before 'return'
   18 |     }
      |      ^
      |      )
   19 | 
   20 |     return 0;
      |     ~~~~~~
a.cc:8:8: note: to match this '('
    8 |     for(){
      |        ^
Language: C++

 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 
 using namespace std;

 int main()
 {
   int num;
   while(cin>>num&&num)
   { 
     int sum2,sum5;
     sum2=sum5=0;
     //cin>>num;
     for(int i=2;i<=num;i++)
     {
       int kk=i;
       while((kk%2==0))
       {
         sum2++;
         kk/=2;                 
       }       
       while((kk%5==0))
       {
         sum5++;
         kk/=5;                
       } 
     }         
     int qin=min(sum2,sum5);
     cout<<qin<<endl;       
   }
  }
   //while(1);
   return 0;
 }

Compiler output:
a.cc:48:4: error: expected unqualified-id before 'return'
   48 |    return 0;
      |    ^~~~~~
a.cc:49:2: error: expected declaration before '}' token
   49 |  }
      |  ^
Language: C++

#include <stdio.h>
int max(int a,int b){
if(a>b)return a;
return b;
}
int main(){
int n,a,b,temp;
while(1){
scanf("%d",&n);
if(n==0)return 0;
a=b=0;
for(int i=2;i<n;i++){
temp=i;
while(temp%2){
temp/=2;
a++;
}
while(temp%5){
temp/=5;b++;
}

}
printf("%d\n",max(a,b);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: expected ')' before ';' token
   23 | printf("%d\n",max(a,b);
      |       ~               ^
      |                       )
Language: C++

#include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                     ^
a.cc:1:9: fatal error: cstdio>mai: No such file or directory
    1 | #include<cstdio>main(){for(int n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      | ^
a.cc:1:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |     ^~~~
a.cc: In function 'int main()':
a.cc:1:29: error: 'n' was not declared in this scope
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                             ^
a.cc:1:17: error: 'scanf' was not declared in this scope
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                 ^~~~~
a.cc:1:49: error: 's' was not declared in this scope
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                                 ^
a.cc:1:35: error: 'printf' was not declared in this scope
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | n,s;main(){for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
Language: C++

main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'n' was not declared in this scope
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |        ^
a.cc:1:10: error: 's' was not declared in this scope
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |          ^
a.cc:1:17: error: 'scanf' was not declared in this scope
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                 ^~~~~
a.cc:1:35: error: 'printf' was not declared in this scope
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
Language: C++

main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:21: error: 'scanf' was not declared in this scope
    1 | main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                     ^~~~~
a.cc:1:39: error: 'printf' was not declared in this scope
    1 | main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){int n,s;for(;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
Language: C++

main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:12: error: 'n' was not declared in this scope
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |            ^
a.cc:1:14: error: 's' was not declared in this scope
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |              ^
a.cc:1:16: error: 'scanf' was not declared in this scope
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                ^~~~~
a.cc:1:34: error: 'printf' was not declared in this scope
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
      |                                  ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){for(n,s;scanf("%d",&n)&&n;printf("%d\n",s))for(s=0;n;s+=n/=5);}
Language: C++

a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);}
      | ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | a;main(n){for(;scanf("%d",&n),n;printf("%d\n",a))for(a=0;n;a+=n/=5);}
      |       ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>

using namespace std;

int main()
{
	unsigned long n,c5;

	while(1){
		cin>>n; if(n==0) return 0;
		c5=0;
		for(unsigned long i=1;i<=n;i++){
			unsigned long j=i;

			while(j%5==0){c5++;j/=5;}
		}
		else cout<<c5<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'else' without a previous 'if'
   22 |                 else cout<<c5<<endl;
      |                 ^~~~
Language: C++

#include <cstdio>

using namespace std;

int main(){
	int n,sum;
	while(~scanf("%d",&n){
		sum=0;
		while(n>4){
			sum+=n/5;
			n/=5;
		}
		printf("%d\n",sum);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: expected ')' before '{' token
    7 |         while(~scanf("%d",&n){
      |              ~               ^
      |                              )
Language: C++

main()
{
  long long int i,j,x;
  for(;scanf("%lld",&i),i;printf("%lld\n",j))
      for(j=0,x=5;i/x;x*=5)
	j+=i/x;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:8: error: 'scanf' was not declared in this scope
    4 |   for(;scanf("%lld",&i),i;printf("%lld\n",j))
      |        ^~~~~
a.cc:4:27: error: 'printf' was not declared in this scope
    4 |   for(;scanf("%lld",&i),i;printf("%lld\n",j))
      |                           ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main()
Language: C++

import java.util.*;

public class MAIN{
	public static void main(String[] args){
		int n;
		Scanner scan = new Scanner(System.in);
		while(true){
			n = scan.nextInt();
			if(n == 0){
				break;
			}
			System.out.println("" + aoj0052(n));
		}
	}
	static int aoj0052(int n){
		int res = 0, m = 0;
		for(int i = n;i / 5 != 0;i/=5){
			m++;
		}
		while(m > 0){
			res += n / (int)Math.pow(5.0, (double)m);
			m--;
		}
		return res;
	}
}

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

import java.util.Scanner;

public class Main {
	
	static ArrayList<Integer> list=new ArrayList<>();
	static boolean[] prime=new boolean[104730];
	
	static void eratos() {
		for(int i=2; i<104730; i++) {
			prime[i]=true;
		}
		for(int i=2; i<104730; i++) {
			if(prime[i]) {
				list.add(i);
				for(int j=2; i*j<104730; j++) {
					prime[i*j]=false;
				}
			}
		}
	}
	
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			eratos();
			while(sc.hasNext()) {
				int n=sc.nextInt();
				if(n==0) break;
				int sum=0;
				for(int i=0; i<n; i++) {
					sum+=list.get(i);
				}
				System.out.println(sum);
			}
			
			
		}
	}
}


Compiler output:
Main.java:5: error: cannot find symbol
	static ArrayList<Integer> list=new ArrayList<>();
	       ^
  symbol:   class ArrayList
  location: class Main
Main.java:5: error: cannot find symbol
	static ArrayList<Integer> list=new ArrayList<>();
	                                   ^
  symbol:   class ArrayList
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.math.BigInteger;
 
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int[] ps=new int[20000];
ps[1]=2
BigInteger x=BigInteger.valueOf(ps[1]);
for(int i=2;i<20000;i++){
x=x.nextProbablePrime();
ps[i]+=x.intValue();
}
while(!(line=br.readLine()).equals("0")){
System.out.println(ps[Integer.parseInt(line)]);
}
}
}

Compiler output:
Main.java:9: error: ';' expected
ps[1]=2
       ^
1 error
Language: Java


class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int input=0;
		int sosuko=0;
		long wa=0l;
		int genzai=0;
		boolean ss=false;
		while(sc.hasNext()) {
			input=sc.nextInt();
			sosuko=0;
			wa=0l;
			genzai=0;

			if(input>=1) {
				wa+=2;
				genzai=2;
				sosuko=1;
			}
			if(input==0) {
				System.exit(0);
			}
			genzai=3;
			while(input>sosuko) {
				ss=true;
				for(int j=2; j<=Math.sqrt(genzai)+1;) {
					if(genzai%j==0) {
						genzai+=2;
						ss=false;
						break;
					}
					j++;
				}
				if(ss==true) {
					wa+=genzai;
					sosuko++;
					genzai+=2;
				}
			}
			System.out.println(wa);
		}
	}
}


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

import java.util.Scanner;


public class Test {
	public static void main(String[] args){
		Scanner scan = null;
		try{
			int num;
			int[] prime = new int[10000];
			prime[0] = 2;
			for(int i = 3 ,j = 1;j <prime.length;i += 2){
				boolean check = false;
				for(int k = 3; k < i /2; k += 2){
					if(i % k ==0){
						check = true;
						break;
					}
				}
				if(!check){
					prime[j] = i;
					j++;
				}
			}
			for(scan = new Scanner(System.in);(num = scan.nextInt()) !=0;){
				int sum = 0;
				for(int i = 0; i < num;i++){
					sum += prime[i];
				}
				System.out.println(sum);
			}
		}finally{
			if(scan !=null)scan.close();
		}
	}
}

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

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

int main(){
	int n,m,sum,w;
	while(1){
		cin >> n;
		if(n==0){
			return 0;
		}
		m=0;
		sum=0;
		for(int t=2;m<n;t++){
			w=0;
			for(int i=2;i<=sqrt(t);i++){
				if(t%i==0){
					w++;
				}
			}
			if(w==0){
				sum+=t;
				m++;
			}
		}
		cout << sum << "\n";
	}
}

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

#include<stdio.h>
#include<math.h>
int main(){
int i,j,k;
int sum,n,r,s[10000];
s[0]=2;
for(i=3,j=1;j<10000;i+=2){
r=(int)sqrt(i)+1;
for(k=3;k<r;k+=2){
if(i%k==0)
r=0;
}
if(r){
s[j]=i;
j++
}
for(;;){
scanf("%d",&n);
if(n==0)
break;
sum=0;
for(i=0;i<n;i++)
sum+=s[i];
printf("%d\n",sum);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:4: error: expected ';' before '}' token
   15 | j++
      |    ^
      |    ;
   16 | }
      | ~   
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>
int main(){
int i,j,k;
int sum,n,r,s[10000];
s[0]=2;
for(i=3,j=1;j<10000;i+=2){
r=(int)sqrt(i)+1;
for(k=3;k<r;k+=2){
if(i%k==0)
r=0;
}
if(r){
s[j]=i;
j++;
}
for(;;){
scanf("%d",&n);
if(n==0)
break;
sum=0;
for(i=0;i<n;i++)
sum+=s[i];
printf("%d\n",sum);
}
return 0;
}

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

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

int main(){
	int n;
	int a[10000];
	int b;
	int i, j, p;
	int c[10000][2];
	p = 1;
	while (true){
		scanf("%d", &c[p][0]);
		if(c[p][0]!=0)p++;
		else break;
	}
	//p--;
		b = (int)pow(10000.0, 0.5);
		a[0] = -1;
		for (i = 2; i <= b; i++){
			for (j = 2; j <= 10000/ i; j++){
				a[i*j - 1] = -1;
			}
		}
	//	printf("%d-%d\n",c[0][0],c[1][0]);
	for (i = 1; i < p; i++){	
		c[i][1] = 0;
		for (j = 1;c[i][0]>0; j++){
			if (a[j - 1] != -1){ 
				c[i][1]+=j; 
				c[i][0]--;
			}
		}
		printf("%d\n", c[i][1]);
	}

	return 0;
}

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

bool isPrime(int j){
	int k = j;
	if(j < 2) return false;
	if(j == 2) return true;
	if(j % 2 == 0) return false;
	while(j >2){
		if(k % (j-1) ==0 ) return false;
		j = j-1;

	}
	return true;

}
int main(void)
{
	int s,n;
	for(;;){
		int i,j=0;
		s = 0;
		scanf("%d",&n);
		for(i = 0; i<10000;i++){
			if(isPrime(i+1)){
				j = j+1;
				s+= i +1;

			}
			if(j >= n) break;
		}
		printf("%d\n",s);
		if(n==0)break;
		
	}
	return 0;

}

Compiler output:
main.c:1:1: error: unknown type name 'bool'
    1 | bool isPrime(int j){
      | ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | bool isPrime(int j){
main.c: In function 'isPrime':
main.c:3:26: error: 'false' undeclared (first use in this function)
    3 |         if(j < 2) return false;
      |                          ^~~~~
main.c:3:26: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:3:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:27: error: 'true' undeclared (first use in this function)
    4 |         if(j == 2) return true;
      |                           ^~~~
main.c:4:27: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:20:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |                 scanf("%d",&n);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | bool isPrime(int j){
main.c:20:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |                 scanf("%d",&n);
      |                 ^~~~~
main.c:20:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:29:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |                 printf("%d\n",s);
      |                 ^~~~~~
main.c:29:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main(void)
{
  int sosuu[10000];
  int i,j,k,l,n,sum,flag;
  k=1;
  sosuu[0]=2;
  for(i=3;i<=10000;i+=2){
    flag=0;
    for(j=2;j<i;j++){
      if(i%j==0){
	flag=1;
	break;
      }
    }
    if(flag==0){
      sosuu[k]=i;
      k++;
    }
  }
  while(scanf("%d",&n)!=EOF){
    sum=0;
    for(l=0;l<n;l++){
      sum+=sosuu[l];
    }
    printf("%d\n",sum);
  }
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:20:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:20:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:25: error: 'EOF' undeclared (first use in this function)
   20 |   while(scanf("%d",&n)!=EOF){
      |                         ^~~
main.c:20:25: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:20:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |     printf("%d\n",sum);
      |     ^~~~~~
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main(void)
{
  int sosuu[20000];
  int i,j,k,l,n,sum,flag;
  k=1;
  sosuu[0]=2;
  for(i=3;i<=110000;i+=2){
    flag=0;
    for(j=2;j<i;j++){
      if(i%j==0){
	flag=1;
	break;
      }
    }
    if(flag==0){
      sosuu[k]=i;
      k++;
    }
  }
  while(scanf("%d",&n)!=EOF){
    sum=0;
    for(l=0;l<n;l++){
      sum+=sosuu[l];
    }
    printf("%d\n",sum);
  }
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:20:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:20:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:25: error: 'EOF' undeclared (first use in this function)
   20 |   while(scanf("%d",&n)!=EOF){
      |                         ^~~
main.c:20:25: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:20:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |     printf("%d\n",sum);
      |     ^~~~~~
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(void)
{
????int sosuu[10001];
????int i,j,k,l,n,sum,flag;
????k=1;
????sosuu[0]=2;
????for(i=3;i<=110000;i+=2){
????????flag=0;
????????for(j=2;j<i;j++){
????????????if(i%j==0){
????????flag=1;
????????break;
????????????}
????????}
????????if(flag==0){
????????????sosuu[k]=i;
????????????k++;
????????}
????????if(k==10000){
????????????break;
????????}
????}
????while(scanf("%d",&n)!=EOF){
????????sum=0;
????????for(l=0;l<n;l++){
????????????sum+=sosuu[l];
????????}
????????printf("%d\n",sum);
????}
????return 0;
??????
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
    4 | ????int sosuu[10001];
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????int i,j,k,l,n,sum,flag;
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????k=1;
      | ^
main.c:6:5: error: 'k' undeclared (first use in this function)
    6 | ????k=1;
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:1: error: expected expression before '?' token
    7 | ????sosuu[0]=2;
      | ^
main.c:7:5: error: 'sosuu' undeclared (first use in this function)
    7 | ????sosuu[0]=2;
      |     ^~~~~
main.c:8:1: error: expected expression before '?' token
    8 | ????for(i=3;i<=110000;i+=2){
      | ^
main.c:32:1: error: expected expression before '?' token
   32 | ??????
      | ^
Language: C

int main(void)
{
  int sosuu[10001];
  int i,j,k,l,n,sum,flag;
  k=1;
  sosuu[0]=2;
  sosuu[2]=3;
  for(i=5;i<=110000;i+=2){
    flag=0;
    for(j=3;j<i;j+=2){
      if(i%j==0){
	flag=1;
	break;
      }
    }
    if(flag==0){
      sosuu[k]=i;
      k++;
    }
    if(k==10000){
      break;
    }
  }
  while(scanf("%d",&n)!=EOF){
    sum=0;
    for(l=0;l<n;l++){
      sum+=sosuu[l];
    }
    printf("%d\n",sum);
  }
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:24:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   24 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:24:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   24 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:25: error: 'EOF' undeclared (first use in this function)
   24 |   while(scanf("%d",&n)!=EOF){
      |                         ^~~
main.c:24:25: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:24:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d\n",sum);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main(void)
{
  int sosuu[10001];
  int i,j,k,l,n,sum,flag;
  k=1;
  sosuu[0]=2;
  sosuu[1]=3;
  for(i=5;i<=110000;i+=2){
    flag=0;
    for(j=3;j<i;j+=2){
      if(i%j==0){
	flag=1;
	break;
      }
    }
    if(flag==0){
      sosuu[k]=i;
      k++;
    }
    if(k==10000){
      break;
    }
  }
  while(scanf("%d",&n)!=EOF){
    sum=0;
    for(l=0;l<n;l++){
      sum+=sosuu[l];
    }
    printf("%d\n",sum);
  }
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:24:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   24 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:24:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   24 |   while(scanf("%d",&n)!=EOF){
      |         ^~~~~
main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:25: error: 'EOF' undeclared (first use in this function)
   24 |   while(scanf("%d",&n)!=EOF){
      |                         ^~~
main.c:24:25: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:24:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |     printf("%d\n",sum);
      |     ^~~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(void)
{
????int sosuu[10001];
????int i,j,k,l,n,sum,flag;
????k=1;
????sosuu[0]=2;
????sosuu[1]=3;
????for(i=5;i<=120000;i+=2){
????????flag=0;
????????for(j=3;j<i;j+=2){
????????????if(i%j==0){
????????flag=1;
????????break;
????????????}
????????}
????????if(flag==0){
????????????sosuu[k]=i;
????????????k++;
????????}
????????if(k==10000){
????????????break;
????????}
????}
????while(scanf("%d",&n)!=EOF){
????????sum=0;
????????for(l=0;l<n;l++){
????????????sum+=sosuu[l];
????????}
????????printf("%d\n",sum);
????}
????return 0;
??
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
    4 | ????int sosuu[10001];
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????int i,j,k,l,n,sum,flag;
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????k=1;
      | ^
main.c:6:5: error: 'k' undeclared (first use in this function)
    6 | ????k=1;
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:1: error: expected expression before '?' token
    7 | ????sosuu[0]=2;
      | ^
main.c:7:5: error: 'sosuu' undeclared (first use in this function)
    7 | ????sosuu[0]=2;
      |     ^~~~~
main.c:8:1: error: expected expression before '?' token
    8 | ????sosuu[1]=3;
      | ^
main.c:9:1: error: expected expression before '?' token
    9 | ????for(i=5;i<=120000;i+=2){
      | ^
main.c:33:1: error: expected expression before '?' token
   33 | ??
      | ^
Language: C

#include <stdio.h>

int IsPrime(void);

int main(void){
	int n , p[10001] , count = 2 , sum_p[10001];
	p[1] = 2;
	for(n=3;count<=10000;n+=2){
		if(IsPrime(n)){
			p[count] = n;
			count++;
		}
	}
	sum_p[1] = 2;
	for(n=1;n<10000;n++){
		sum_p[n+1] = sum_p[n] + p[n+1];
	}
	while(1){
		scanf("%d" , &n);
		if(n==0) break;
		printf("%d\n" , sum_p[n]);
	}
	return 0;
}

int IsPrime(int n){
	int i;
	if(n==1) return 0;
	if(n==2){
		return 1;
	}else if(n%2==0){
		return 0;
	}
	for(i=3;i*i<=n;i+=2){
		if(n%i==0){
			return 0;
		}
	}
	return 1;
}

Compiler output:
main.c: In function 'main':
main.c:9:20: error: too many arguments to function 'IsPrime'
    9 |                 if(IsPrime(n)){
      |                    ^~~~~~~
main.c:3:5: note: declared here
    3 | int IsPrime(void);
      |     ^~~~~~~
main.c: At top level:
main.c:26:5: error: conflicting types for 'IsPrime'; have 'int(int)'
   26 | int IsPrime(int n){
      |     ^~~~~~~
main.c:3:5: note: previous declaration of 'IsPrime' with type 'int(void)'
    3 | int IsPrime(void);
      |     ^~~~~~~
Language: C

促袖#include<stdio.h>
main()
{

  int x, y, n, s,cnt = 0,count;
  int a[1000000] = {0};

  for(x = 2;x < 1000000;x++){
    for(y = x + x;y < 1000000;y += x){
      a[y] = 1;
    }
  }



  while(1){
    scanf("%d", &n);
    if(n==0)
      break;
    count=0;
    x=2;
    s=0;
    while(count<n){
      if(a[x]==0){
	s+=x;
	count++;
      }
      x++;
    }
  

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

Compiler output:
main.c:1:5: error: stray '#' in program
    1 | 促袖#include<stdio.h>
      |     ^
main.c:1:1: error: unknown type name '\U00004fc3\U00008896'
    1 | 促袖#include<stdio.h>
      | ^~~~
main.c:1:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | 促袖#include<stdio.h>
      |             ^
Language: C

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

int n,s,c,f,h,i,k=0;
int p[10010];
bool j[1000000];
int main(){
	memset(j,true,1000000);
	for(i=2;k<10000;i++){
		if(j[i]==true){
			p[k]=i;
			k++;
			for(h=2;h*i<1000000;h++){
				j[h*i]=false;
			}
		}
	}
	
	scanf("%d",&n);
	while(n!=0){s=0;
		for(i=0;i<n;i++)s+=p[i];
		printf("%d\n",s);
		scanf("%d",&n);
	}
	return 0;
}

Compiler output:
main.c:6:1: error: unknown type name 'bool'
    6 | bool j[1000000];
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include<string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c: In function 'main':
main.c:8:18: error: 'true' undeclared (first use in this function)
    8 |         memset(j,true,1000000);
      |                  ^~~~
main.c:8:18: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:40: error: 'false' undeclared (first use in this function)
   14 |                                 j[h*i]=false;
      |                                        ^~~~~
main.c:14:40: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
#define P_EDGE 200000
 
int makelist(int* list,int kazu){
    int i,j;
    for(i=0;i<kazu;i++){
        list[i]=1;
    }
    list[0]=0;
    list[1]=0;
    for(i=2;i<kazu;i++){
        if(list[i]){
            for(j=2*i;j<kazu;j+=i){
                list[j]=0;
            }
        }
    }
    return 0;
}

int main(){
	int plist[P_EDGE];
	int n,c;
	long long int ans
	int i;
	makelist(plist,P_EDGE);
	while(1){
		c=0;
		ans=0;
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<P_EDGE;i++){
			if(plist[i]!=0){
				c++;
				ans+=i;
				if(c==n){
					break;
				}
			}
		}
		printf("%lld\n",ans);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:26: error: expected ';' before 'int'
   24 |         long long int ans
      |                          ^
      |                          ;
   25 |         int i;
      |         ~~~               
main.c:29:17: error: 'ans' undeclared (first use in this function)
   29 |                 ans=0;
      |                 ^~~
main.c:29:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define DATA 1000000

int prime[DATA];

int is_prime(int n){
  int i;
  if(n < 2) return 0;
  for(i = 2 ; i*i <= n ; i++){
    if(n % i == 0) return 0;
  }
  return 1;
}

void judge(){
  int i;

  for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i);
  
  return;
}


int main(void){
  int n,i,sum;

  judge();

  for(;;){
    sum = 0;

    scanf("%d" ,&n);
    if(n == 0) break;

    for(i = 0 ; n > 0 ; i++){
      if(prime[i] == 1){
	 sum += i;
         n--;
	}    
    }

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

Compiler output:
main.c: In function 'judge':
main.c:18:19: error: 'SIZE' undeclared (first use in this function)
   18 |   for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i);
      |                   ^~~~
main.c:18:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define DATA 1000000

int prime[DATA];

int is_prime(int n){
  int i;
  if(n < 2) return 0;
  for(i = 2 ; i <= n ; i++){
    if(n % i == 0) return 0;
  }
  return 1;
}

void judge(){
  int i;

  for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i);
  
  return;
}


int main(void){
  int n,i,sum;

  judge();

  for(;;){
    sum = 0;

    scanf("%d" ,&n);
    if(n == 0) break;

    for(i = 0 ; n > 0 ; i++){
      if(prime[i] == 1){
	 sum += i;
         n--;
	}    
    }

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

Compiler output:
main.c: In function 'judge':
main.c:18:19: error: 'SIZE' undeclared (first use in this function)
   18 |   for(i = 0 ; i < SIZE ; i++) prime[i] = is_prime(i);
      |                   ^~~~
main.c:18:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int num[104730], Pnum[10000], n, ans;

	int k = 0;
	memset(Pnum, 1, sizeof(int));
	for (int i = 2; i < 104730; i++) {
		if (num[i]) {
			Pnum[k] = i;
			k++;
			for (int j = i + i; j < 104730; j+=i) {
				num[j] = 0;
			}
		}
	}
	
	while (cin >> n) {
		if (n == 0)	break;

		ans = 0;
		for (int i = 0; i < n; i++) {
			ans += Pnum[i];
		}

		cout << ans << endl;
	}

	return 0;
}

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

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

int main(){

bool N[10002];
for(int i=0;i<10001;i++)
N[i]=false;

for(int i=3;i<=10001;i+=2)
for(int j=2;j<=sqrt((double)i);j++)
{if(i%j==0){N[i]=false;}else{N[i]=true}}

N[2]=true;N[3]=true;

int n;
while(1){

scanf("%d",&n);if(n==0)break;
int s=0;
for(int i=0;i<=n;i++)
if(N[i]=true)s+=i;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:39: error: expected ';' before '}' token
   12 | {if(i%j==0){N[i]=false;}else{N[i]=true}}
      |                                       ^
      |                                       ;
Language: C++

import java.util.Scanner;

class Main{
	public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    int n,s;
    boolean is;
    
    while(sc.hasNextInt()){
    	n = sc.nextInt();
    	if(n == 0)break;
    	s = 0;
    	
    	for(int i = 2; n != 0; i++){
    		is = true;
    		
    		for(int j = 2; j <= Math.sqrt(i); j++)
    			if(i % j == 0)is = false;
    		
    		if(is){
    			n--;
    			s += i;
    		}
    	}
    	System.out.println(s);
    }
    sc.close();
  }
}

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:4:15: error: expected ':' before 'static'
    4 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:4:42: error: expected ',' or '...' before 'args'
    4 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:30:2: error: expected ';' after class definition
   30 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:5: error: 'Scanner' was not declared in this scope
    5 |     Scanner sc = new Scanner(System.in);
      |     ^~~~~~~
a.cc:8:5: error: 'boolean' was not declared in this scope; did you mean 'bool'?
    8 |     boolean is;
      |     ^~~~~~~
      |     bool
a.cc:10:11: error: 'sc' was not declared in this scope; did you mean 's'?
   10 |     while(sc.hasNextInt()){
      |           ^~
      |           s
a.cc:16:17: error: 'is' was not declared in this scope; did you mean 'i'?
   16 |                 is = true;
      |                 ^~
      |                 i
a.cc:18:37: error: 'Math' was not declared in this scope
   18 |                 for(int j = 2; j <= Math.sqrt(i); j++)
      |                                     ^~~~
a.cc:26:9: error: 'System' was not declared in this scope
   26 |         System.out.println(s);
      |         ^~~~~~
a.cc:28:5: error: 'sc' was not declared in this scope; did you mean 's'?
   28 |     sc.close();
      |     ^~
      |     s
Language: C++

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

int main(){
	int n,i,j,p[10000],sum=0;
	while(scanf("%d",&n)!=0){
		for(i=2;;i++){
			for(j=2;j<=sqrt(i);j++){
			if(i%j==0)break;
			if(j==(int)sqrt(i)){p[n]=i;n--;break;}
			}
			if(n==0)break;
		}

		for(i=n;i>0;i--){sum += p[i];}
		printf("%d",&sum);

	}

}

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

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

int main(){
	int n,i,j,p[10000],sum=0;
	while(scanf("%d",&n)!=0){
		for(i=2;;i++){
			for(j=2;j<=sqrt(i);j++){
			if(i%j==0)break;
			if(j==(int)sqrt(i)){p[n]=i;n--;break;}
			}
			if(n==0)break;
		}

		for(i=n;i>0;i--){sum += p[i];}
		printf("%d",sum);

	}

}

Compiler output:
a.cc:2:9: fatal error: math: No such file or directory
    2 | #include<math>
      |         ^~~~~~
compilation terminated.