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

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

int main(void)
{
	int n;
	char buf[256];
	
	
	while (fgets(buf, 256, stdin){
		
		n = atoi(buf);
		ans = 0;
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				for (int k = 0; k < 10; k++){
					for (int l = 0; l < 10; l++){
						if (i + j + k + l == n){
							ans++;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: expected ')' before '{' token
   10 |         while (fgets(buf, 256, stdin){
      |               ~                      ^
      |                                      )
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |                 ans = 0;
      |                 ^~~
      |                 abs
Language: C++

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

int main(void)
{
	int n;
	char buf[256];
	
	
	while (fgets(buf, 256, stdin) != NULL){
		
		n = atoi(buf);
		ans = 0;
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				for (int k = 0; k < 10; k++){
					for (int l = 0; l < 10; l++){
						if (i + j + k + l == n){
							ans++;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |                 ans = 0;
      |                 ^~~
      |                 abs
Language: C++

#inlcude<cstdio>

int solve(int a,int b){
 
 if(b==4){
  if(a==0) return 1;
  else return 0; 
 }
 else{
  int res=0;
  for(int i=0;i<=a&&i<10;i++){
   res+=solve(a-i,b+1);
  }
  return res;
 }
}

int main(){
 int n;
 while(~scanf("%d",&n)){
  printf("%d\n",solve(n,0));
}
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<cstdio>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:20:9: error: 'scanf' was not declared in this scope
   20 |  while(~scanf("%d",&n)){
      |         ^~~~~
a.cc:21:3: error: 'printf' was not declared in this scope
   21 |   printf("%d\n",solve(n,0));
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inlcude<cstdio>
Language: C++

#include<iostream>
using namespace std;
int main(){
int n;
int num=0;
while(cin>>a){
for(int h=0;h<=9;h++){
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=0;k<=9;k++){
if(h+i+j+k==a){num++;}
}
}
}
}
cout<<num<<endl;
num=0;
}
}

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

#include <iostream>
using namespace std;

int main(){
int n;
while(~scanf("%d",&n)){
int res = 0;
for(int a=0;a<=9;a++)
for(int b=0;b<=9;b++)
for(int c=0;c<=9;c++)
for(int d=0;d<=9;d++)
if(a+b+c+d == n) res++;
}

printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'res' was not declared in this scope
   15 | printf("%d\n",res);
      |               ^~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
int n;
while(cin>>n){
int res=0;
for(int n1=0;n1<=9;n1++)
for(int n2=0;n2<=9;n2++)
for(int n3=0;n3<=9;n3++)
for(int n4=0;n4<=9;n4++)
if(n1+n2+n3+n4==n) res++
cout<<res<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected ';' before 'cout'
   13 | if(n1+n2+n3+n4==n) res++
      |                         ^
      |                         ;
   14 | cout<<res<<endl;
      | ~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,c,d,n,C;
while(cin>>n){
C=0;
a=0;
b=0;
c=0;
d=0;
for(int i=0;i<9;i++){
for(int j=0;j<10;j++){
for(int k=0;k<10;k++){
for(int l=0;l<10;l++){
if(a+b+c+d=n)C++;
l++;}
k++;}
j++;}
i++;}
cout<<C;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: lvalue required as left operand of assignment
   15 | if(a+b+c+d=n)C++;
      |    ~~~~~^~
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,c,d,n,C;
while(cin>>n){
C=0;
a=0;
b=0;
c=0;
d=0;
for(int i=0;i<9;i++){
for(int j=0;j<10;j++){
for(int k=0;k<10;k++){
for(int l=0;l<10;l++){
if(a+b+c+d=n)C++;
d++;}
c++;}
b++;}
a++;}
cout<<C;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: lvalue required as left operand of assignment
   15 | if(a+b+c+d=n)C++;
      |    ~~~~~^~
Language: C++

#include <iostream>
using namespace std;

#define f(i) for(int i=0; i<10; ++i)


//0008
int main(){
	int x;

	while(cin >> x){
		int a,b,c,d;
		int cout=0;

		f(a)f(b)f(c)f(d){
			if(a+b+c+d == x){
				++count;
			}
		}
		cout << cout <<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: 'count' was not declared in this scope; did you mean 'cout'?
   17 |                                 ++count;
      |                                   ^~~~~
      |                                   cout
a.cc:20:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |                 cout << cout <<endl;
      |                 ~~~~~~~~~~~~~^~~~~~
Language: C++

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

int DP[10][100];
int N;

int main()
{
	while(scanf("%d",&N)!=EOF)
	{
		memset(DP,0,sizeof(DP));
		DP[0][0]=1;
		for(int i= 0;i<=4;i++)
		{
			for(int j=0;j<=N;j++)
			{
				for(int k=0;k<10;k++)
				{
					DP[i+1][j+k]+=DP[i][j];
				}
			}
		}
		printf("%d\n",DP[4][N]);
	}

}

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

#include<cstdio>
#include<algorithm>
#include<memory>
#include<string>
using namespace std;

int DP[10][100];
int N;

int main()
{
	while(scanf("%d",&N)!=EOF)
	{
		memset(DP,0,sizeof(DP));
		DP[0][0]=1;
		for(int i= 0;i<=4;i++)
		{
			for(int j=0;j<=N;j++)
			{
				for(int k=0;k<10;k++)
				{
					DP[i+1][j+k]+=DP[i][j];
				}
			}
		}
		printf("%d\n",DP[4][N]);
	}
　　　return 0;
}

Compiler output:
a.cc:28:1: error: extended character 　 is not valid in an identifier
   28 | 　　　return 0;
      | ^
a.cc:28:1: error: extended character 　 is not valid in an identifier
a.cc:28:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(DP,0,sizeof(DP));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<string>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc:28:1: error: '\U00003000\U00003000\U00003000return' was not declared in this scope
   28 | 　　　return 0;
      | ^~~~~~~~~~~~
Language: C++

include <iostream>

using namespace std;


int main()
{

	int n,count;
	int a,b, c,d;
	while(cin >> n){

		//a>=b>=c>=dと仮定
		count = 0;
		for( a = 0; a < 10; a++ ) {
			if ( a > n ) 
				continue;
			for( b = 0; b < a+1; b++ ) {
				if( a + b > n )
					continue;
				for( c = 0; c < b+1; c++ ) {
					if( a + b + c > n ) 
						continue;
					d = n - a - b- c;
					if( d > c )
						continue;
				if( a == d )//全部同じ
					count += 1;
				else if( a == c || b == d)//１つ異なる
					count += 4;
				else if( a == b && c == d )//2つずつ同じ
					count += 6;
				else if( a == b || b == c || c == d )//2つ同じ
					count += 12;
				else
					count += 24;
				}
			}
		}
		cout << count << endl;

	}

	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:11:15: error: 'cin' was not declared in this scope
   11 |         while(cin >> n){
      |               ^~~
a.cc:40:17: error: 'cout' was not declared in this scope; did you mean 'count'?
   40 |                 cout << count << endl;
      |                 ^~~~
      |                 count
a.cc:40:34: error: 'endl' was not declared in this scope
   40 |                 cout << count << endl;
      |                                  ^~~~
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int main() {
    int n, count;
    while(1) {
      count=0;
      scanf("%d", &n);
      for(int i=0;i<10;i++) {
	for(int j=0;j<10;j++) {
	  for(int k=0;k<10;k++) {
	    if(a+b+c>=n-9 && a+b+c<=n)count++;
	  }
	}
      }
      printf("%d\n", count);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'a' was not declared in this scope
   14 |             if(a+b+c>=n-9 && a+b+c<=n)count++;
      |                ^
a.cc:14:18: error: 'b' was not declared in this scope
   14 |             if(a+b+c>=n-9 && a+b+c<=n)count++;
      |                  ^
a.cc:14:20: error: 'c' was not declared in this scope
   14 |             if(a+b+c>=n-9 && a+b+c<=n)count++;
      |                    ^
Language: C++

9#include<iostream>
using namespace std;

int main(void)
{
  int e=0,n=0;
  while(cin >> n){
  for(int a =0;a < 10;++a){
    for(int b= 0;b < 10;++b){
      for(int c= 0;c < 10 ; ++c){
        for(int d=0 ;d < 10;++d){
        if(a+b+c+d == n){
         e +=1;
         }
        }
      }
    }
  }
  cout << e << endl;
  e = 0;
 }
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | 9#include<iostream>
      |  ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 9#include<iostream>
      | ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |   while(cin >> n){
      |         ^~~
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout << e << endl;
      |   ^~~~
a.cc:19:16: error: 'endl' was not declared in this scope
   19 |   cout << e << endl;
      |                ^~~~
Language: C++

#include <iostream>
 using namespace std;
int main()
{
    int n;
    while (cin >> n) 
{
        int combo = 0;
        for (int a = 0; a < 10; ++a) 
{
        for (int b = 0; b < 10; ++b) 
{
        for (int c = 0; c < 10; ++c) 
{
        for (int d = 0; d < 10; ++d) 
{
            if (a + b + c + d == n) 
{
                ++combo
}
        }}}}
        cout << combo <<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: expected ';' before '}' token
   19 |                 ++combo
      |                        ^
      |                        ;
   20 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int n;
	while (cin>>n)
	{
		int combo = 0;
		for (int a=0;a<10;++a)
		{
			for (int b=0;b<10;++b)
		{
			for (int c=0;c<10;++c)
		{
			for (int d=0;d<10;++d)
			{
				if(a+b+c+d==n)
					++combo;
			}
			}
			}
		}
		cout<<combo<<endl;
	}
	return 0;
	cin.get();
	getch();
}

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

#include<iostream>
#include <conio.h>
using namespace std;

int main()
{
	int n;
	while (cin>>n)
	{
		int combo = 0;
		for (int a=0;a<10;++a)
		{
			for (int b=0;b<10;++b)
		{
			for (int c=0;c<10;++c)
		{
			for (int d=0;d<10;++d)
			{
				if(a+b+c+d==n)
					++combo;
			}
			}
			}
		}
		cout<<combo<<endl;
	}
	return 0;
	cin.get();
	getch();
}

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

#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
int n;
int count;

 while(cin>>n)
 {
     for ( int a=0;a<=9;a++)
          for ( int b=0;b<=9;b++)
               for ( int c=0;c<=9;c++)
                    for ( int d=0;d,=9;d++)
                         if (a +b+c+d == n)
                             count++;
 } 

    cout<<count;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:37: error: expected primary-expression before '=' token
   19 |                     for ( int d=0;d,=9;d++)
      |                                     ^
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
int n;
int count;

 while(cin>>n)
 {
     for ( int a=0;a<=9;a++)
          for ( int b=0;b<=9;b++)
               for ( int c=0;c<=9;c++)
                    for ( int d=0;d,=9;d++)
                         if (a +b+c+d == n)
                             count++;
 } 

    cout<<count<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:37: error: expected primary-expression before '=' token
   19 |                     for ( int d=0;d,=9;d++)
      |                                     ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
int n;
int count=0;

 while(cin>>n)
 {
     for ( int a=0;a<=9;a++)
          for ( int b=0;b<=9;b++)
               for ( int c=0;c<=9;c++)
                    for ( int d=0;d,=9;d++)
                         if (a +b+c+d == n)
                             count++;
 } 

    cout<<count<<endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected primary-expression before '=' token
   15 |                     for ( int d=0;d,=9;d++)
      |                                     ^
Language: C++

#include<iostream>
using namespace std;

int main(void){
  int dp[50][4];
  for(int i = 0; i < 50; i++){
    for(int j = 0; i < 4; j++){
      if(i < 10 && j = 0)
	dp[i][j] = 1;
      else
	dp[i][j] = 0;
    }
  }
  
  for(int i = 1; i < 4; i++){
    for(int j = 0; j < 10; j++){
      for(int k = 0; k < 36; k++){
	if(k - j >= 0){
	  dp[k][i] += dp[k - j][i - 1];
	}
      }
    }
  }
  
  int n;
  while(cin >> n){
    cout << dp[n][3] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: lvalue required as left operand of assignment
    8 |       if(i < 10 && j = 0)
      |          ~~~~~~~^~~~
Language: C++

#include<iostream>
using namespace std;

int main(void){
  int c;
  while(cin >> c){
    int cnt = 0;
    for(i = 0; i < 10; i++)
      for(j = 0; j < 10; j++)
	for(k = 0; k < 10; k++)
	  for(l = 0; l < 10; l++)
	    if(i * j * k * l == n)
	      cnt++;
    cout << cnt << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i = 0; i < 10; i++)
      |         ^
a.cc:9:11: error: 'j' was not declared in this scope
    9 |       for(j = 0; j < 10; j++)
      |           ^
a.cc:10:13: error: 'k' was not declared in this scope
   10 |         for(k = 0; k < 10; k++)
      |             ^
a.cc:11:15: error: 'l' was not declared in this scope
   11 |           for(l = 0; l < 10; l++)
      |               ^
a.cc:12:33: error: 'n' was not declared in this scope
   12 |             if(i * j * k * l == n)
      |                                 ^
Language: C++

#include<iosteram>
using namespace std;

int main(){
int n,ans;
while(cin>>n){
ans=0;
for(i=0;i<10;i++){
for(j=0;j<10;j++){
for(k=0;k<10;k++){
for(l=0;l<10;l++){
if(i+j+k+l==n){ans++;}}}}}cout<<ans<<endl;}}

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

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

int main(){
int a[5][51];
int b;
int c;
int d;
b=1;
while(b<5){
c=0;
while(c<51){
a[b][c]=0;
c=c+1;}
b=b+1;}

b=0;
while(b<10){
a[1][b]=1;
b=b+1;}

b=2;
while(b<5){
c=0;
while(c<51){
d=0;
while(d<9){
if(c>=d){a[b][c]=a[b][c]+a[b-1][c-d];}
d=d+1;}
c=c+1:}
b=b+1;}
int n;
while(cin >> n){
cout << a[4][n] << endl;}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:6: error: expected ';' before ':' token
   31 | c=c+1:}
      |      ^
      |      ;
Language: C++

#include <iostream>

void main()
{
	int n;
	while( std::cin >> n )
	{
		int num = 0;
		for( int i1=0; i1<=9; ++i1 )
		{
			for( int i2=0; i2<=9; ++i2 )
			{
				for( int i3=0; i3<=9; ++i3 )
				{
					for( int i4=0; i4<=9; ++i4 )
					{
						num += i1+i2+i3+i4 == n;
					}
				}
			}
		}

		std::cout << num;
	}
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
Language: C++

#include <iostream>

void main()
{
	int n;
	while( std::cin >> n )
	{
		int num = 0;
		for( int i1=0; i1<=9; ++i1 )
		{
			for( int i2=0; i2<=9; ++i2 )
			{
				for( int i3=0; i3<=9; ++i3 )
				{
					for( int i4=0; i4<=9; ++i4 )
					{
						num += (i1+i2+i3+i4 == n);
					}
				}
			}
		}

		std::cout << num;
	}
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
Language: C++

#include <iostream>
using namespace std;
int h[51];
int main() {
 int a,b,c,d,n,j=0,m;
 for (m=0; m<10000; m++) {
	 a=m/1000; b=(m-a*1000)/100;
	 c=(m-a*1000-b*100)/10; d=m-a*1000-b*100-c*10;
     h[a+b+c+d]++;
 }
 while(cin >> n) cout << h[n] << endl;
 return 0;

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

#include <iostream>
using namespace std;

int main(){
  int n;
  while(cin >> n){
    int a = 0, b = 0, c = 0, d = 0, m = 0;
    for(int i = 0; i < 10; i++){
      for(int j = 0; j < 10; j++){
	for(int k = 0; k < 10; k++){
	  for(int l = 0; l < 10; l++){
	    if(i+j+k+l == n) m++;
	  }
	}
      }
    }
  }

  cout << m << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'm' was not declared in this scope
   19 |   cout << m << endl;
      |           ^
Language: C++

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

int main(){
  int n;
  while(cin >> n){
    int a = 0, b = 0, c = 0, d = 0, m = 0;
    for(int i = 0; i < 10; i++){
      for(int j = 0; j < 10; j++){
	for(int k = 0; k < 10; k++){
	  for(int l = 0; l < 10; l++){
	    if(i+j+k+l == n) m++;
	  }
	}
      }
    }
  }

  cout << m << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'm' was not declared in this scope
   20 |   cout << m << endl;
      |           ^
Language: C++

#include <iostream>

using namespace std;

int main(void){
	int n,a[4],count;

	while(cin >> n){
		count=0;
		for(a[0]=0;a[0]<10;a[0]++)
			for(a[1]=0;a[1]<10;a[1]++)
				for(a[2]=0;a[2]<10;a[2]++)
					for(a[3]=0;a[3]<10;a[3]++)
						if(a[0]+a[1]+a[2]+a[3]==n){
							count++
							break;
						}
		cout << count << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:64: error: expected ';' before 'break'
   15 |                                                         count++
      |                                                                ^
      |                                                                ;
   16 |                                                         break;
      |                                                         ~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
long nn[]={1,4,10,20,35,56,84,120,165,220,282,348,415,480,540,592,633,660,670,
660,633,592,540,480,415,348,282,220,165,120,84,56,35,20,10,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(;;){
cin>>n;
if(cin.eof())break;
cout<<nn[n]<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'n' was not declared in this scope; did you mean 'nn'?
    8 | cin>>n;
      |      ^
      |      nn
Language: C++

#include<iostream>
using namespace std;

int main()
{
 int x,y; 
 while(cin>>x)
 {
   for(int a=0; a<=9; a++)
    {
      for(int b=0; b<=9; b+=)
        {
          for(int c=0; c<=9; c++)
            {
               for(int d=0; d<=9; d++)
                 {
                   if(a+b+c+d==0) y++;
                 }}}}
                cout<<y<<endl;
               }
                return 0;
                  }
                 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected primary-expression before ')' token
   11 |       for(int b=0; b<=9; b+=)
      |                             ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
 int x,y; 
 while(cin>>x)
 {
   for(int a=0; a<=9; a++)
    {
      for(int b=0; b<=9; b+=)
        {
          for(int c=0; c<=9; c++)
            {
               for(int d=0; d<=9; d++)
                 {
                   if(a+b+c+d=0) y++;
                 }}}}
                cout<<y<<endl;
               }
                return 0;
                  }
                 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected primary-expression before ')' token
   11 |       for(int b=0; b<=9; b+=)
      |                             ^
a.cc:17:28: error: lvalue required as left operand of assignment
   17 |                    if(a+b+c+d=0) y++;
      |                       ~~~~~^~
Language: C++

#include<iostream>

using namespace std;

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

	while(cin>>num){
		int answer = 0;
		for(int a = 0;a != 10;++a){
			for(int b = 0;b != 10;++b){
				for(int c = 0;c != 10;++c){
					for(int d = 0;d != 10;++d)
						if(a+b+c+d==num)
							answer++;
				}
			}
		}
	}
	cout <<answer<<endl;

	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'answer' was not declared in this scope
   22 |         cout <<answer<<endl;
      |                ^~~~~~
Language: C++

#include <stdio.h>
int main(void){
int n;
while(scanf("%d",&n)!=EOF){
int count=0;
for(int a=9;a>=0;a--){
for(int b=9;b>=0;b--){
for(int c=9;c>=0;c--){
for(int d=9;d>=0;d--){
if(a+b+c+d==n){
count++;
}
}
}
}
}
}
printf("%d\n",count);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'count' was not declared in this scope
   18 | printf("%d\n",count);
      |               ^~~~~
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
int ans[51];
void rec(int sum, int d){
  if(d == 4){
    ans[sum]++;
    return;
  }
  for(int i = 0 ; i <10; i++){
    rec(sum+i,d+1);
  }
}
void init(){
  memset(ans,0,sizeof(ans));
  rec(0,0);
}
int main(){
  int n;
  init();
  while(cin >> n){
    cout << ans[n] << endl;
  }
  return 0;
}
#include <iostream>
#include <cstring>
using namespace std;
int ans[51];
void rec(int sum, int d){
  if(d == 4){
    ans[sum]++;
    return;
  }
  for(int i = 0 ; i <10; i++){
    rec(sum+i,d+1);
  }
}
void init(){
  memset(ans,0,sizeof(ans));
  rec(0,0);
}
int main(){
  int n;
  init();
  while(cin >> n){
    cout << ans[n] << endl;
  }
  return 0;
}

Compiler output:
a.cc:29:5: error: redefinition of 'int ans [51]'
   29 | int ans[51];
      |     ^~~
a.cc:4:5: note: 'int ans [51]' previously declared here
    4 | int ans[51];
      |     ^~~
a.cc:30:6: error: redefinition of 'void rec(int, int)'
   30 | void rec(int sum, int d){
      |      ^~~
a.cc:5:6: note: 'void rec(int, int)' previously defined here
    5 | void rec(int sum, int d){
      |      ^~~
a.cc:39:6: error: redefinition of 'void init()'
   39 | void init(){
      |      ^~~~
a.cc:14:6: note: 'void init()' previously defined here
   14 | void init(){
      |      ^~~~
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main(){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n;
while(scanf("%d,"&n)){
int ans=0;
for(int a=0;a<10;a++){
for(int b=0;b<10;b++){
for(int c=0;c<10;c++){
for(int d=0;d<10;d++){
if(a+b+c+d==n)ans++;
}
}
}
}
printf("%d\n",ans);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid operands of types 'const char [4]' and 'int' to binary 'operator&'
    7 | while(scanf("%d,"&n)){
      |             ~~~~~^~
      |             |     |
      |             |     int
      |             const char [4]
Language: C++

#include <stdio.h>

int main( void ){
    int nCount = 0;
    int n[];
    while( true ){
    

    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n ) nCount++;
                }
            }
       }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: storage size of 'n' isn't known
    5 |     int n[];
      |         ^
Language: C++

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( &n[m] );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;i < m;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    }
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets( &n[m] );
      |         ^~~~
      |         getw
a.cc:11:21: error: 'atoi' was not declared in this scope
   11 |         if(( n[m] = atoi(str)) == -1 ) break;
      |                     ^~~~
a.cc:14:20: error: 'i' was not declared in this scope
   14 |     for( int a = 0;i < m;a++ ){
      |                    ^
Language: C++

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;i < m;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    }
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |         gets( str );
      |         ^~~~
      |         getw
a.cc:11:21: error: 'atoi' was not declared in this scope
   11 |         if(( n[m] = atoi(str)) == -1 ) break;
      |                     ^~~~
a.cc:14:20: error: 'i' was not declared in this scope
   14 |     for( int a = 0;i < m;a++ ){
      |                    ^
Language: C++

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;a < m;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    }
    return 0;
} 

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

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == 0 ) break;
        m++;
    }
    for( int a = 0;a < m;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    }
    return 0;
} 

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

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;a < m+1;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    nCount = 0;
    }
    return 0;
} 

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

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == 0 ) break;
        m++;
    }
    for( int a = 0;a < m+1;a++ ){
    for( int i = 0;i < 10;i++ ){
        for( int j = 0;j < 10;j++ ){
            for( int k = 0;k < 10;k++ ){
                for( int l = 0;l < 10;l++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    nCount = 0;
    }
    return 0;
} 

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

#include<stdio.h>

int main(void){
	int n,ans=0;
	scanf_s("%d",&n);
	for(int a=0;a<10;a++){
		for(int b=0;b<10;b++){
			for(int c=0;c<10;c++){
				for(int d=0;d<10;d++){
					if(n==(a+b+c+d))
						ans++;
				}
			}
		}
	}
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    5 |         scanf_s("%d",&n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	
	scanf("%d", &n);
	
	for (i = 0; i < 10; i++){
		for (j = 0; j < 10; j++){
			for (k = 0; k < 10; k++){
				for (h = 0; h < 10; h++){
					if (i + j + k + h == n){
						sum++;
					}
				}
			}
		}
	}
	
	printf("%d\n", sum);
	
	return (0);
}

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

#include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	while (scanf("%d", &n) != EOF){
		
		sum = 0;
		
		for (i = 0; i < 10; i++){
			for (j = 0; j < 10; j++){
				for (k = 0; k < 10; k++){
					for (h = 0; h < 10; h++){
						if (i + j + k + h == n){
							sum++;
						}
					}
				}
			}
		}
	
	
		printf("%d\n", sum);
	}
	return (0);
}

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

mport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = "";

        while ((line = br.readLine()) != null && !line.isEmpty()) {
            int n = Integer.parseInt(line);
            int m = n - 1;
            boolean[] ns = new boolean[n + 1];

            for (int i = 2; i < n + 1; i++) {
                if (ns[i])
                    continue;
                for (int j = 2; j < n / i + 1; j++) {
                    if (!ns[i * j]) {
                        //System.out.println(i * j);
                        ns[i * j] = true;
                        m--;
                    }
                }
            }
            System.out.println(m);
        }
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
3 errors
Language: Java

import java.util.Scanner;
class Main {
    boolean primeList[1000000];
    public static void prime() {
        for(int i = 0; i < 1000000; i ++) primeList[i] = true;
        primeList[0] = false; primeList[1] = false;
        for(int i = 2; i * i < 1000000; i ++) if(primeList[i]) for(int j = i * i; j < 1000000; j += i) primeList[j] = false;
    }
    public static int solve(int n) {
        int m = 0;
        for(int i = 0; i <= n; i ++) if(primeList[i]) m ++;
        return m;
    }
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        prime();
        while(scan.hasNext()) {
        int n = scan.nextInt();
        System.out.println(solve(n));
    }
}

Compiler output:
Main.java:3: error: ']' expected
    boolean primeList[1000000];
                      ^
Main.java:21: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

import java.util.Scanner;
class Main {
    boolean primeList = new primeList[1000000];
    public static void prime() {
        for(int i = 0; i < 1000000; i ++) primeList[i] = true;
        primeList[0] = false; primeList[1] = false;
        for(int i = 2; i * i < 1000000; i ++) if(primeList[i]) for(int j = i * i; j < 1000000; j += i) primeList[j] = false;
    }
    public static int solve(int n) {
        int m = 0;
        for(int i = 0; i <= n; i ++) if(primeList[i]) m ++;
        return m;
    }
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        prime();
        while(scan.hasNext()) {
        int n = scan.nextInt();
        System.out.println(solve(n));
    }
}

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

import java.util.Scanner;
class Main {
    static boolean[] primeList = new boolean[1000000];
    public static void prime() {
        for(int i = 0; i < 1000000; i ++) primeList[i] = true;
        primeList[0] = false; primeList[1] = false;
        for(int i = 2; i * i < 1000000; i ++) if(primeList[i]) for(int j = i * i; j < 1000000; j += i) primeList[j] = false;
    }
    public static int solve(int n) {
        int m = 0;
        for(int i = 0; i <= n; i ++) if(primeList[i]) m ++;
        return m;
    }
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        prime();
        while(scan.hasNext()) {
            int n = scan.nextInt();
            System.out.println(solve(n));
    }
}

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

import java.util.Scanner;
class Main {
    static boolean primeList[] = new boolean[1000000];
    public static void prime() {
        for(int i = 0; i < 1000000; i ++) primeList[i] = true;
        primeList[0] = false; primeList[1] = false;
        for(int i = 2; i * i < 1000000; i ++) if(primeList[i]) for(int j = i * i; j < 1000000; j += i) primeList[j] = false;
    }
    public static int solve(int n) {
        int m = 0;
        for(int i = 0; i <= n; i ++) if(primeList[i]) m ++;
        return m;
    }
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        prime();
        while(scan.hasNext()) {
            int n = scan.nextInt();
            System.out.println(solve(n));
    }
}

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

import java.util.Scanner;
public class Main {
    static boolean[] primeList = new boolean[1000000];
    public static void prime() {
        for(int i = 0; i < 1000000; i ++) primeList[i] = true;
        primeList[0] = false; primeList[1] = false;
        for(int i = 2; i * i < 1000000; i ++) if(primeList[i]) for(int j = i * i; j < 1000000; j += i) primeList[j] = false;
    }
    public static int solve(int n) {
        int m = 0;
        for(int i = 0; i <= n; i ++) if(primeList[i]) m ++;
        return m;
    }
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        prime();
        while(scan.hasNext()) {
            int n = scan.nextInt();
            System.out.println(solve(n));
    }
}

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

public class Main {
	void run(){
		int answer = 0;
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int input = sc.nextInt();
			boolean[] primelist = new boolean[input];
			Arrays.fill(primelist, true);
			primelist[0] = false;
			primelist[1] = false;

			for(int i = 0; i < primelist.length;i++){
				if(primelist[i]){
					//System.out.println(i);
					for(int j = i + i; j < input; j+=i){
						primelist[j] = false;			
					}
					++answer;
				}
			}	
			System.out.println(answer);
		}
	}
	public static void main(String[] args) {
		new Main().run();

	}
}

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
Main.java:8: error: cannot find symbol
			Arrays.fill(primelist, true);
			^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){prime++;}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
boolean f=true;
for(int i=2;i<n;i++){
if(x%i==0){
f=false;
break;
}
}
}
}

Compiler output:
Main.java:19: error: illegal start of expression
public static boolean prime_number(int x){
^
1 error
Language: Java

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
boolean f=true;
for(int i=2;i<n;i++){
if(x%i==0){
f=false;
break;
}
}
}

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

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
boolean f=true;
for(int i=2;i<n;i++){
if(x%i==0){
f=false;
break;
}
}
}
}

Compiler output:
Main.java:24: error: cannot find symbol
for(int i=2;i<n;i++){
              ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
boolean f=true;
for(int i=2;i<x;i++){
if(x%i==0){
f=false;
break;
}
}
}
}

Compiler output:
Main.java:30: error: missing return statement
}
^
1 error
Language: Java

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
boolean f=true;
for(int i=2;i<x;i++){
if(x%i==0){
f=false;
break;
}
return f;
}
}
}

Compiler output:
Main.java:31: error: missing return statement
}
^
1 error
Language: Java

import java.util.Scanner;
  
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
for(int i=2;i<x;i++){
int amari=x%i;
if(amari==0){
return false;
break;
}
}
return true;
}
}

Compiler output:
Main.java:27: error: unreachable statement
break;
^
1 error
Language: Java

import java.util.Scanner;
    
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime=0;
if(n>=2){
prime+=1;
if(n>2){
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
}
}
System.out.println(prime);
}
public static boolean prime_number(int x){
for(int i=2;i<x;i++){
int amari=x%i;
if(amari==0){
return false;
}
}
return true;
}
}

Compiler output:
Main.java:20: error: cannot find symbol
System.out.println(prime);
                   ^
  symbol:   variable prime
  location: class Main
1 error
Language: Java

import java.util.Scanner;
    
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int prime;
if(n==2){
prime=1;
}
else if(n>2){
prime++;
for(int i=3;i<=n;i++){
if(prime_number(i)){
prime++;
}
}
}
else{prime=0;}
System.out.println(prime);
}
}
public static boolean prime_number(int x){
for(int i=2;i<x;i++){
int amari=x%i;
if(amari==0){
return false;
}
}
return true;
}
}

Compiler output:
Main.java:13: error: variable prime might not have been initialized
prime++;
^
1 error
Language: Java

import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
boolean[] prime=new boolean[MAX];
int num=0;
while(sc.hasNextInt()){
int n=sc.nextInt();
if(n>3){
for(int i=2;i<n;i++){
prime[i]=true;
}
for(int i=2;i<n;i++){
if(prime[i]){
num++;
for(int j=2*i;j<n;j+=i){
prime[j]=false
}
}
}
}
else{
prime=n-1
}
System.out.println(num);
}
}

Compiler output:
Main.java:18: error: ';' expected
prime[j]=false
              ^
Main.java:24: error: ';' expected
prime=n-1
         ^
Main.java:28: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
boolean[] prime=new boolean[MAX];
int num=0;
while(sc.hasNextInt()){
int n=sc.nextInt();
if(n>3){
for(int i=2;i<n;i++){
prime[i]=true;
}
for(int i=2;i<n;i++){
if(prime[i]){
num++;
for(int j=2*i;j<n;j+=i){
prime[j]=false;
}
}
}
}
else{
prime=n-1;
}
System.out.println(num);
}
}
}

Compiler output:
Main.java:6: error: cannot find symbol
boolean[] prime=new boolean[MAX];
                            ^
  symbol:   variable MAX
  location: class Main
Main.java:24: error: incompatible types: int cannot be converted to boolean[]
prime=n-1;
       ^
2 errors
Language: Java

import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int num=0;
while(sc.hasNextInt()){
int n=sc.nextInt();
boolean[] prime=new boolean[n];
if(n>3){
for(int i=2;i<n;i++){
prime[i]=true;
}
for(int i=2;i<n;i++){
if(prime[i]){
num++;
for(int j=2*i;j<n;j+=i){
prime[j]=false;
}
}
}
}
else{
prime=n-1;
}
System.out.println(num);
}
}
}

Compiler output:
Main.java:24: error: incompatible types: int cannot be converted to boolean[]
prime=n-1;
       ^
1 error
Language: Java

import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int MAX=1000000;
int count=0;
boolean[] prime=new boolean[MAX];
prime[0]=false;
prime[1]=false;
while(sc.hasNextInt()){
int n=sc.nextInt();
for(int i=2;i<=n;i++){
prime[i]=true;
}
for(int i=0;i<=n;i++){
if(prime[i]){
count++;
for(int j=i+i;j<=n;j+=i){
prime[j]=false;
}
}
}
}
System.out.println(count);
}
}
}

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

import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	/**
	 * 6 ?????\????????£?????´??° n ?????\?????????n ??\???????´???°????????????????????????????????????????????°??????????????????????????????
	 * 
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		// TODO ?????????????????????????????????????????????
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		System.out.println("??°????????\???:");
		int inputNum = Integer.parseInt(br.readLine());
		int count = 0; // ?´???°????????°

		for (int i = 2; i <= inputNum; i++) {
			int yakusuu = 0; // ?´???°?????°

			for (int j = 2; j < i; j++) {
				if (i % j == 0) {
					yakusuu += 1;

				}
			}
			// ?´???°????????¨???????????????????´???°
			if (yakusuu == 0) {
				count += 1;
			}
		}
		System.out.println(count);
	}

}

Compiler output:
Main.java:19: error: illegal escape character
		System.out.println("???????????\???:");
		                                ^
1 error
Language: Java

import java.util.Scanner;

public class Main2 {

    //?¨????????????????
    public int kazu(int num){

        //?´???°??????????????????????????°????????????
        int count = 0;
        //?´???°?????????????????????
        boolean result;

        for(int i = 2; i < num; i++){
            //?´???°??§????????¨?????????????????????
            result = true;
            for(int j = 2; j < i; j++){
                if(i % j == 0){
                    //?´???°???????????´????´???°??§??????
                    result = false;
                    break;
                }
            }
            //??????????????§?????????????´???°??¨??????????????????
            if(result)count++;
        }
        return count;
    }

    public static void main(String[] args){
    	Scanner sc = new Scanner (System.in);
        //?????????????????°???????´?????????????
        
        Main2 sosu = new Main2();
        int num = sc.nextInt();
        while(num < 100000){
        	System.out.println(sosu.kazu(num));
        	num = sc.nextInt();
        	
        }


    }

}

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

	public static void main(String[] args) {
		int n = 35;
		int a,b,c,d;
		int cnt = 0;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				if(i+j > n) break;
				for (int k = 0; k < 10; k++) {
					if(i+ j + k > n) break;
					for (int l = 0; l < 10; l++) {
						if(i+j+k+l > n) break;
						if(i+j+k+l == n) {
							cnt++;
							System.out.println(i + " " + j + " " + k + " " + l);
						}
					}
				}
			}
		}
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PrimeNumber {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		while((line = br.readLine())!= null){
			int n = Integer.parseInt(line);
			int count = 0;
			int[] furui = new int[n+1];
			for(int i = 2 ; i < n/2+1;i++){
				for(int j = 0;j<n+1;j++){
					if(j!=i && j%i==0){
						furui[j] = -1;
					}
				}
			}
			
			for(int i = 2; i < n+1;i++){
				if(furui[i] == 0){
					count++;
				}
			}
			System.out.println(count);
		}

	}

}

Compiler output:
Main.java:6: error: class PrimeNumber is public, should be declared in a file named PrimeNumber.java
public class PrimeNumber {
       ^
1 error