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

#include <iostream>

using namespace std;
int main()
{
 int x,y,N1,i,a,answer;
 cin>>x>>y;
 if(x>=y)
 {
  N1=x;
  N2=y;
 }else
 {
  N1=y;
  N2=x;
 } 
 
 while(1)
 {
  a=N1%N2 
  if(a==0){
    cout<<N2<<endl;
    break
  }endl{
    N1=N2
    N2=a
 }
 

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'N2' was not declared in this scope; did you mean 'N1'?
   11 |   N2=y;
      |   ^~
      |   N1
a.cc:15:3: error: 'N2' was not declared in this scope; did you mean 'N1'?
   15 |   N2=x;
      |   ^~
      |   N1
a.cc:20:8: error: 'N2' was not declared in this scope; did you mean 'N1'?
   20 |   a=N1%N2
      |        ^~
      |        N1
a.cc:24:8: error: expected ';' before '{' token
   24 |   }endl{
      |        ^
      |        ;
a.cc:27:2: error: statement cannot resolve address of overloaded function
   27 |  }
      |  ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>

using namespace std;
int main()
{
 int x,y,N1,N2,i,a;
 cin>>x>>y;
 if(x>=y)
 {
  N1=x;
  N2=y;
 }else
 {
  N1=y;
  N2=x;
 } 
 
 while(1)
 {
  a=N1%N2 
  if(a==0){
    cout<<N2<<endl;
    break
  }endl{
    N1=N2
    N2=a
 }
 

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected ';' before 'if'
   20 |   a=N1%N2
      |          ^
      |          ;
   21 |   if(a==0){
      |   ~~      
a.cc:24:8: error: expected ';' before '{' token
   24 |   }endl{
      |        ^
      |        ;
a.cc:27:2: error: statement cannot resolve address of overloaded function
   27 |  }
      |  ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
#include<utility>

int gcd(int x,int y){
    int z
    if(x<y) std::swap(x,y);
    while(y>0){
        z=x%y;
        x=y;
        y=z;
    }
    return x;
}

int main(void){
    int x,y;
    std::cin>>x>>y;
    std::cout<<gcd(x,y)<<std::endl;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:5: error: expected initializer before 'if'
    6 |     if(x<y) std::swap(x,y);
      |     ^~
a.cc:8:9: error: 'z' was not declared in this scope
    8 |         z=x%y;
      |         ^
Language: C++

#include<iostream>
using namespace std;
int gcd(int x,int y){
  if(x%y==0)return y;
  else return gcd(b,a%b); 
}
int main(){
  int a,b;
  cin >> a>>b;
  cout <<gcd(a,b)<<endl;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:19: error: 'b' was not declared in this scope
    5 |   else return gcd(b,a%b);
      |                   ^
a.cc:5:21: error: 'a' was not declared in this scope
    5 |   else return gcd(b,a%b);
      |                     ^
Language: C++

#include<bits/stdc++>
using namespace
 
int main(){
    int a,b,c;
    cin>>a>>b;
    while(a==0){
        if(a<b)swap(a,b);
        a%=b;
    }cout<<b;
    return 0;
}


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

#include<bits/stdc++.h>
using namespace
 
int main(){
    int a,b,c;
    cin>>a>>b;
    while(a==0){
        if(a<b)swap(a,b);
        a%=b;
    }cout<<b;
    return 0;
}


Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>a>>b;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:16: error: 'swap' was not declared in this scope
    8 |         if(a<b)swap(a,b);
      |                ^~~~
a.cc:8:16: note: suggested alternatives:
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181:
/usr/include/c++/14/bits/regex.h:2230:5: note:   'std::__cxx11::swap'
 2230 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/stdexcept:38,
                 from /usr/include/c++/14/system_error:43,
                 from /usr/include/c++/14/bits/ios_base.h:46,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_path.h:736:15: note:   'std::filesystem::__cxx11::swap'
  736 |   inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
      |               ^~~~
a.cc:10:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     }cout<<b;
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <stdio.h>
 
int gcd(int x,int y){
  if(x<y){
    swap(x,y);
  }
  while(y>0){
    int r=x%y;
    x=y;
    y=r;
  }
  return x;
}
 
int main(){
  int x,y;
  scanf("%d%d",&x,&y)
  printf("%d\n",gcd(x,y));
 
  return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:5: error: 'swap' was not declared in this scope
    5 |     swap(x,y);
      |     ^~~~
a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before 'printf'
   17 |   scanf("%d%d",&x,&y)
      |                      ^
      |                      ;
   18 |   printf("%d\n",gcd(x,y));
      |   ~~~~~~
Language: C++

#include <stdio.h>
 
int gcd(int x,int y){
  if(x<y){
    swap(x,y);
  }
  while(y>0){
    int r=x%y;
    x=y;
    y=r;
  }
  return x;
}
 
int main(){
  int x,y;
  scanf("%d%d",&x,&y);
  printf("%d\n",gcd(x,y));
 
  return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:5: error: 'swap' was not declared in this scope
    5 |     swap(x,y);
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

const int inf = 1e9 + 7;

int main() {
	int x,y;
	cin >> x >> y;
	int d = min(x,y);
	while(){
		if(x%d == 0 && y%d == 0){
			cout << d << endl;
			return 0;
		}
		d--;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected primary-expression before ')' token
   13 |         while(){
      |               ^
Language: C++

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

int main(){
  int x, y;
  cin >> x;
  cin >> y;

  int residue = -1;
  while(residue != 0){
    residue = max(x, y) % min(x, y);
    residue = 0;
    int ans = 3;
//    if(x>y) x = residue;
//    else y = residue;
  }
  cout << ans << endl;
  return ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

int main(){
  int x, y;
  cin >> x;
  cin >> y;

  int residue = -1;
  int ans;
  
  while(residue != 0){
    residue = max(x, y) % min(x, y);
    ans = x>y?y:x
    if(x>y) x = residue;
    else y = residue;
    ans = min(x, y);
  }
  cout << ans << endl;
  return ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected ';' before 'if'
   22 |     ans = x>y?y:x
      |                  ^
      |                  ;
   23 |     if(x>y) x = residue;
      |     ~~            
a.cc:24:5: error: 'else' without a previous 'if'
   24 |     else y = residue;
      |     ^~~~
Language: C++

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

int main(){
  int x, y;
  cin >> x;
  cin >> y;

  int residue = -1;
  int answer;
  while(residue != 0){
    residue = max(x, y)%min(x, y);
    if(residue==0) break;
    if(x>y) x = residue;
    else y = residue;
  }
  
  answer = min(x, y);

  cout << answer << endl;
    
  return ans;
}



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

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

int main(){
  int x, y;
  cin >> x;
  cin >> y;

  int residue = -1;
  int answer;
  while(residue != 0){
    residue = max(x, y)%min(x, y);
    if(residue==0) break;
    if(x>y) x = residue;
    else y = residue;
  }
  
  ans = min(x, y);

  cout << ans << endl;
    
  return -1;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |   ans = min(x, y);
      |   ^~~
      |   abs
Language: C++

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

int main(){
  int x, y;
  cin >> x;
  cin >> y;

  int residue = -1;
  int answer;
  /*
  while(residue != 0){
    residue = max(x, y)%min(x, y);
    if(residue==0) break;
    if(x>y) x = residue;
    else y = residue;
  }*/
  
  ans = min(x, y);

  cout << ans << endl;
    
  return -1;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   ans = min(x, y);
      |   ^~~
      |   abs
Language: C++

#include<stdio.h>


void gcd(int x, int y){
 
  int t=0;
  if(y==0)
    output(x);
  else{
    t = x%y;
    gcd(y,t);
  }
}

void output(int x){
  printf("%d",x);
  putchar('\n');
}



int main(void){
  int x=0;
  int y=0;

  scanf("%d",&x);
  scanf("%d",&y);

 
  gcd(x,y);

  return 0;
}

  



Compiler output:
a.cc: In function 'void gcd(int, int)':
a.cc:8:5: error: 'output' was not declared in this scope
    8 |     output(x);
      |     ^~~~~~
Language: C++

l=input().split()
l = [int(s) for s in l]
for i in range(1,l[0]):
    if l[0] % i == 0 and l[1] % i == 0:
        c = i
print(c)



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

l=input().split()
l = [int(s) for s in l]
for i in range(1,l[0]+1):
    if l[0] % i == 0 and l[1] % i == 0:
        c = i
print(c)



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

#include <stdio.h>

int main(){
    int x, y, z;
    scanf("%d%d", &x, &y);
    
    z = gcd(x, y); // 最大公約数を求める
    
    printf("%d\n", z);  // 最大公約数を表示
}

int gcd(x, y){
    int z, str;
    if(x < y) { // x > y として計算するため
        str = y; y = x; x = str; // xとyを交換
    }
    // ユークリッドの互除法を実行 //
    while(y > 0){
        z = x % y; // xをyで割った余りを求める
        
        // 次のループで新しく割り算を実行するため新しくxとyをセットする
        x = y;
        y = z;
    }
    return x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'gcd' was not declared in this scope
    7 |     z = gcd(x, y); // 最大公約数を求める
      |         ^~~
a.cc: At global scope:
a.cc:12:9: error: 'x' was not declared in this scope
   12 | int gcd(x, y){
      |         ^
a.cc:12:12: error: 'y' was not declared in this scope
   12 | int gcd(x, y){
      |            ^
a.cc:12:13: error: expression list treated as compound expression in initializer [-fpermissive]
   12 | int gcd(x, y){
      |             ^
Language: C++

#include <iostream>
using namespace std;

int main() {
gcd(x, y)
    if x < y
        swap(x, y)
    while y > 0
        r = x % y
        x = y
        y = r

	return x;
}


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

#include <iostream>
using namespace std;

int main() {
	cin >> x >> y;
gcd(x, y)
    if (x < y){
        swap(x, y);
    }
    while (y > 0){
        r = x % y;
        x = y;
        y = r;

	return x;
    }
	cout << x << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'x' was not declared in this scope
    5 |         cin >> x >> y;
      |                ^
a.cc:5:21: error: 'y' was not declared in this scope
    5 |         cin >> x >> y;
      |                     ^
a.cc:6:1: error: 'gcd' was not declared in this scope
    6 | gcd(x, y)
      | ^~~
a.cc:11:9: error: 'r' was not declared in this scope
   11 |         r = x % y;
      |         ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int x , y , r;
    cin >> x >> y;
    if(x < y){
        int a = y;
        y = x;
        x = a;
    }
    do{
        r = x % y;
        x = y;
        y = r;
    }while(r != 0);
    cout << x << endl;
 


Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected '}' at end of input
   17 |     cout << x << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <math.h>

int gcd(double x, double y)
{
	int m = (int)floor(x);
	int n = (int)floor(y);
	int r;

	do {
		r = m % n;
		m = n;
		n = r;
	} while (r != 0);

	return m;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream.h>

int gcd(int a,int b)
{
	if (a%b==0)
	{
		return(b);
    }
	else
	{
		return(gcd(b,a%b));
    }
}

int main()
{
    int x,y;
    cout << "1番目の整数を入力してください\n";
    cin >> x;
    cout << "2番目の整数を入力してください\n";
    cin >> y;
    cout << "2つの数の最大公約数は" << gcd(x,y) << "です\n";
    return 0;
}


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


#include <stdio.h>
#include <errno.h>
int main(int argc, char **argv)
{
unsigned long int x[2];
if (argc > 2) {
int i, c;
argv++;
for (i = 0; i < 2; i++) {
char *t;
x[i] = strtoul(argv[i], &t, 10);
if (errno)
return 1;
if (*t)
return 2;
}
printf("最大公約数 %lu\n最小公倍数 %lu\n", gcd(x[0],x[1]),lcm(x[0],x[1]));
}
return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:12:8: error: 'strtoul' was not declared in this scope
   12 | x[i] = strtoul(argv[i], &t, 10);
      |        ^~~~~~~
a.cc:18:44: error: 'gcd' was not declared in this scope
   18 | printf("最大公約数 %lu\n最小公倍数 %lu\n", gcd(x[0],x[1]),lcm(x[0],x[1]));
      |                                            ^~~
a.cc:18:59: error: 'lcm' was not declared in this scope
   18 | printf("最大公約数 %lu\n最小公倍数 %lu\n", gcd(x[0],x[1]),lcm(x[0],x[1]));
      |                                                           ^~~
Language: C++

#include <iostream>
using namespace std;
unsigned int GCD(const unsigned int a, const unsigned int b) {
unsigned int x, y, memo; x = a; y = b;
memo = x%y;
while (memo) {
x = y;
y = memo;
memo = x%y;
}
return y


Compiler output:
a.cc: In function 'unsigned int GCD(unsigned int, unsigned int)':
a.cc:11:9: error: expected ';' at end of input
   11 | return y
      |         ^
      |         ;
a.cc:11:9: error: expected '}' at end of input
a.cc:3:62: note: to match this '{'
    3 | unsigned int GCD(const unsigned int a, const unsigned int b) {
      |                                                              ^
Language: C++

int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", GCD(x, y));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
    3 | scanf("%d %d", &x, &y);
      | ^~~~~
a.cc:4:16: error: 'GCD' was not declared in this scope
    4 | printf("%d\n", GCD(x, y));
      |                ^~~
a.cc:4:1: error: 'printf' was not declared in this scope
    4 | printf("%d\n", GCD(x, y));
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){
Language: C++

#include<iostream>
using namespace std;
int calc_gcd(int a,int b){
int x=a,y=b,z;
if(x<y){
z=x;
x=y;
y=z;
}
while(y>0){
z=x%y;
x=y;
y=z;
}
return x;
}
int main(){
int a,b;
cin>>a>>b;
cout<<calc_gcd(a,b)<<endl;
return 0;


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

#include<iostream>
using namespace std;

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

int main(){
int a,b;
cin >> a >> b;
cout << gcd(a,b)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 | cout << gcd(a,b)
      |                 ^
      |                 ;
   10 | }
      | ~
Language: C++

#include <cstdio>
int a,b;
int main(){
  scanf("%d %d",&a,&b);
  for(int i=min(a,b);i>=1;i--){
    if(a%i==0 && b%i==0){
      printf("%d\n",i);
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: 'min' was not declared in this scope; did you mean 'main'?
    5 |   for(int i=min(a,b);i>=1;i--){
      |             ^~~
      |             main
Language: C++

#include <iostream>
using namespace std;
int main()
{
 int a,b,tmp;
 cin >> a >> b;
 while(b!=0){
  tmp = b;
  b = a % b;
  a = tmp;
  }
 cout << a???<< endl;
}

Compiler output:
a.cc:12:12: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
   12 |  cout << a???<< endl;
a.cc: In function 'int main()':
a.cc:12:12: error: expected primary-expression before '?' token
   12 |  cout << a???<< endl;
      |            ^
a.cc:12:13: error: expected primary-expression before '?' token
   12 |  cout << a???<< endl;
      |             ^
a.cc:12:14: error: expected primary-expression before '<<' token
   12 |  cout << a???<< endl;
      |              ^~
a.cc:12:21: error: expected ':' before ';' token
   12 |  cout << a???<< endl;
      |                     ^
      |                     :
a.cc:12:21: error: expected primary-expression before ';' token
a.cc:12:21: error: expected ':' before ';' token
   12 |  cout << a???<< endl;
      |                     ^
      |                     :
a.cc:12:21: error: expected primary-expression before ';' token
a.cc:12:21: error: expected ':' before ';' token
   12 |  cout << a???<< endl;
      |                     ^
      |                     :
a.cc:12:21: error: expected primary-expression before ';' token
Language: C++

#include <iostream>

using namespace std;

int main() {
  
  int a, b; cin >> a >> b;
  
  cout << __gcd(a, b) << endl;
  
  return 0;
}

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

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

int main() {
  
  int a, b; cin >> a >> b;
  
  cout << __gcd(a, b) << endl;
  
  return 0;
}

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

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

int main() {
  cin >> a >> b;
  if(max(a,b) % min(a,b) == 0) {
    cout << min(a,b) << endl;
    return 0;
  }

  int ans = 0;
  for(int i = 1; i*i <= min(a,b); ++i) {
    if(a % i == 0 && b % i == 0) {
      ans = i;
    }
  }
  cout << ans << endl;
}

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

#include<cstdio>
#include<cmath>

int g(int x, int y){
	return (y == 0)? x: g(y, x%y);
}

int main(){
	int a, b;
	scanf("%d%d", &a, &b);
	printf("%d\n", g( max(a, b) , min(a, b)));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
   11 |         printf("%d\n", g( max(a, b) , min(a, b)));
      |                           ^~~
      |                           std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:11:39: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |         printf("%d\n", g( max(a, b) , min(a, b)));
      |                                       ^~~
      |                                       std::min
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
      int md=1,a.b;
      cin>>a>>b;
      while(md>0){
      a=md;
      md=a%b;
      b=a/b;
      }
      cout<<b<<endl;
      return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected initializer before '.' token
    4 |       int md=1,a.b;
      |                 ^
a.cc:5:12: error: 'a' was not declared in this scope
    5 |       cin>>a>>b;
      |            ^
a.cc:5:15: error: 'b' was not declared in this scope
    5 |       cin>>a>>b;
      |               ^
Language: Java

#include <stdio.h>

int isPrime(int);

int main(){
  int i,j;

  int n,cnt=0;


  scanf("%10000d",&n);
  int A[n];
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    if(A[i]<2 || A[i]>100000000){
      continue;
    }


    
    cnt += isPrime(A[i]);

  


  }
 
  //output
  printf("%d\n",cnt);


  return 0;
}
int isPrime(int x){
  int i;
  
  if(x<=1) return 0;

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



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:12: error: not a statement
  int A[n];
        ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: illegal start of expression
  scanf("%10000d",&n);
                  ^
Main.java:12: error: ';' expected
  int A[n];
         ^
Main.java:14: error: illegal start of expression
    scanf("%d",&A[i]);
               ^
7 errors
Language: Java

#include <stdio.h>


int main(){
  int i,j;

  int n,cnt=0;
  int flg;


  scanf("%10000d",&n);
  int A[n];
  for(i=0;i<n;i++){
    flg = 0;
    scanf("%d",&A[i]);
    if(A[i]<2 || A[i]>100000000){
      continue;
    }

    if(A[i]<=1) break;

    for(j=2;j<A[i];j++){
      if( (A[i] % j) == 0 ){
	flg = 1;
	break;
      }
    }

     if( flg == 0) cnt ++;


  }
 
  //output
  printf("%d\n",cnt);


  return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:7: error: class, interface, enum, or record expected
  int n,cnt=0;
  ^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
  int flg;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
  scanf("%10000d",&n);
  ^
Main.java:12: error: class, interface, enum, or record expected
  int A[n];
  ^
Main.java:13: error: class, interface, enum, or record expected
  for(i=0;i<n;i++){
  ^
Main.java:13: error: class, interface, enum, or record expected
  for(i=0;i<n;i++){
          ^
Main.java:13: error: class, interface, enum, or record expected
  for(i=0;i<n;i++){
              ^
Main.java:15: error: class, interface, enum, or record expected
    scanf("%d",&A[i]);
    ^
Main.java:16: error: class, interface, enum, or record expected
    if(A[i]<2 || A[i]>100000000){
    ^
Main.java:18: error: class, interface, enum, or record expected
    }
    ^
Main.java:22: error: class, interface, enum, or record expected
    for(j=2;j<A[i];j++){
    ^
Main.java:22: error: class, interface, enum, or record expected
    for(j=2;j<A[i];j++){
            ^
Main.java:22: error: class, interface, enum, or record expected
    for(j=2;j<A[i];j++){
                   ^
Main.java:25: error: class, interface, enum, or record expected
	break;
	^
Main.java:26: error: class, interface, enum, or record expected
      }
      ^
Main.java:32: error: class, interface, enum, or record expected
  }
  ^
Main.java:38: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:39: error: class, interface, enum, or record expected
}
^
20 errors
Language: Java

import java.util.Scanner;
import java.util.*;

public class AOJ{

   static boolean Sosu(int p){
        int count=0;
        if(p==1) return false;
        else if(p==2) return true;
        else {
            for (int i=2;i<Math.sqrt(p)+1;i++){
            if(p%i==0) count++;
        }
        if(count==0) return true;
        else return false;
    }
   }
    public static void main(String[] args){
        int count=0;
        ArrayList<Integer> list =new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        for(int i=0;i<a;i++){
        int b =sc.nextInt();
        list.add(b);
        }
        for(int i=0;i<list.size();i++){
            if(Sosu(list.get(i))==true) count++; 
        }
        System.out.println(count);
        }
}




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

import java.util.Scanner;

public class Main{

public static void main(String [] args){
Scanner in = new Scanner(System.in);
int count = 0;
while(in.hasNextLine()){
if( i == 2 || i == 3 || i == 5 || i == 7 ||
   (((i % 10 == 1) || (i % 10 == 3) || (i % 10 == 7) || (i % 10 == 9))  
    && (i % 3 != 0 || i % 7 != 0))){
				count++;
			}
}

System.out.println(count);


Compiler output:
Main.java:16: error: reached end of file while parsing
System.out.println(count);
                          ^
1 error
Language: Java

public class Main{	
public static void main (String [] args) {
		Scanner in = new Scanner(System.in);
		int count = 0;
		while(in.hasNextInt()) {
			int i = in.nextInt();
			
			
			if( i == 2 || i == 3 || i == 5 || i == 7 ||
					(((i % 10 == 1) || (i % 10 == 3) || (i % 10 == 7) || (i % 10 == 9))  
					&& (i % 3 != 0 || i % 7 != 0))) {
				count++;
			}
		}
		
		System.out.println(count);
	}
}


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

import java.util.Sc*;

public class Main {
    static int primeCounter = 0;
    
    public static void main (String args[]) {
        // input

        int numEl;
        int numb;

        Scanner inp = new Scanner(System.in);

        numEl = inp.nextInt();

        for (int i = 0; i < numEl; i++) {
            numb = inp.nextInt();

            prime_Counter(numb);
        }

        System.out.println(primeCounter);
    }
    
    public static void prime_Counter(int numb) {
        Boolean primeOrNot = isPrime(numb);
    
        if (primeOrNot == true) {
            primeCounter++;
        }
    }

    public static boolean isPrime(int numb) {
        for(int i = 2; i < numb; i++) {
            if(numb%i == 0) {
                return false;
            }
        }

        return true;
    }
}



Compiler output:
Main.java:1: error: ';' expected
import java.util.Sc*;
                   ^
1 error
Language: Java

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

public class Main101c {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int n=Integer.parseInt(br.readLine());
		int[] in=new int[n];
		for(int i=0;i<n;i++)in[i]=Integer.parseInt(br.readLine());
		in=sizen(in);
		System.out.println(in.length);
		




	}
	static int[] sizen(int[] h){
		StringBuilder stb=new StringBuilder();
		for(int i=0;i<h.length;i++){
			if(h[i]==1)stb.append(h[i]+" ");
			for(int j=h[i]-1;j>0;j--){
				if(j==1)stb.append(h[i]+" ");
				if(h[i]%j==0)break;
				
			}System.out.println(stb);
		}
		String[] st=stb.toString().split(" ");
		int[] sizen=new int[st.length];
		for(int i=0;i<st.length;i++)
			sizen[i]=Integer.parseInt(st[i]);
		
		
		return sizen;
	}

}

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


public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int x = scanner.nextInt();
		int sum = 0;
		for (int i = 0; i < x; i++) {
			int n = scanner.nextInt();
			if (isPrime(n)) {
				sum++;
			}
		}
		System.out.println(sum);
	}

	public static boolean isPrime(int i) {
		if (i == 2)
			return true;
		if (i % 2 == 0)
			return false;
		if (i < 8)
			return true;
		if (i % 3 == 0)
			return false;
		int k = 5;
		while (k * k <= i) {
			if (i % k == 0)
				return false;
			if (i % (k + 2) == 0)
				return false;
			k += 6;
		}
		return true;
	}
}

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

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

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(isPrime(br.readLine()))cnt++;
        }
    }
    public static boolean isPrime(int x){
        if(x % 2 == 0)return false;
        else if(x % 3 == 0)return false;

        for(int i=5; i*i<=x; i+=6){
            if(x % i == 0)return false;
            if(x % (i + 2) == 0)return false;
        }
        return true;
    }
}

Compiler output:
Main.java:11: error: incompatible types: String cannot be converted to int
            if(isPrime(br.readLine()))cnt++;
                                  ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main_prime_numbers {

  public static boolean is_prime(int k) {
    for (int i=2; i*i<=k; i++) 
    if (k%i == 0) return false;
    return k != 1;
  }

  public static void main(String[] args) {
    int i;
    int res = 0;
    Scanner sc = new Scanner(System.in); 
    int n = Integer.parseInt(sc.next());;
    for (i=0; i<n; i++) {
      int a = Integer.parseInt(sc.next());;
      if (is_prime(a)) res++;
    }
    System.out.println(res);
  }
}

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

import java.util.Scanner;


public class PrimeNumbers {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		boolean[] table = new boolean[number+1];
		int min = 2;
		for(int i=2 ; i<number ; i++) {
			if(!table[i])
				min = i;
			else
				continue;

			for(int j=2 ; number>=j*min ; j++) {
				table[j*min] = true;
			}
		}
		if(table[number])
			return 0;
		else
			return 1;
	}

}

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

import java.io.*

public class Main {
  public static void main(String[] args) {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String count = new String(in.readLine());
    int lineCount = Integer.parseInt(n);
    int pFlag = 0;
    int result = 0;
    for(int i = 0; i < lineCount; i++) {
      String num = new String(in.readLine());
      int iNum = Integer.parseInt(num);
      pFlag = 0;
      for(int j = 2; j <= Math.squt(iNum); j++) {
        if(iNum % j == 0) {
          pFlag = 1;
          break;
        }
      }
      if(pFlag == 0) {
        result++;
      }
    }
    System.out.println(result);
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*
                ^
1 error
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String count = new String(in.readLine());
    int lineCount = Integer.parseInt(n);
    int pFlag = 0;
    int result = 0;
    for(int i = 0; i < lineCount; i++) {
      String num = new String(in.readLine());
      int iNum = Integer.parseInt(num);
      pFlag = 0;
      for(int j = 2; j <= Math.squt(iNum); j++) {
        if(iNum % j == 0) {
          pFlag = 1;
          break;
        }
      }
      if(pFlag == 0) {
        result++;
      }
    }
    System.out.println(result);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    int lineCount = Integer.parseInt(n);
                                     ^
  symbol:   variable n
  location: class Main
Main.java:14: error: cannot find symbol
      for(int j = 2; j <= Math.squt(iNum); j++) {
                              ^
  symbol:   method squt(int)
  location: class Math
2 errors
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String count = new String(in.readLine());
    int lineCount = Integer.parseInt(count);
    int pFlag = 0;
    int result = 0;
    for(int i = 0; i < lineCount; i++) {
      String num = new String(in.readLine());
      int iNum = Integer.parseInt(num);
      pFlag = 0;
      for(int j = 2; j <= Math.squt(iNum); j++) {
        if(iNum % j == 0) {
          pFlag = 1;
          break;
        }
      }
      if(pFlag == 0) {
        result++;
      }
    }
    System.out.println(result);
  }
}

Compiler output:
Main.java:14: error: cannot find symbol
      for(int j = 2; j <= Math.squt(iNum); j++) {
                              ^
  symbol:   method squt(int)
  location: class Math
1 error
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String count = new String(in.readLine());
    int lineCount = Integer.parseInt(count);
    int pFlag = 0;
    int result = 0;
    for(int i = 0; i < lineCount; i++) {
      String num = new String(in.readLine());
      int iNum = Integer.parseInt(num);
      pFlag = 0;
      for(int j = 2; j <= Math.sqrt(iNum); j++) {
        if(iNum % j == 0) {
          pFlag = 1;
          break;
        }
      }
      if(pFlag == 0) {
        result++;
      }
    }
    System.out.println(result);
  }
}

Compiler output:
Main.java:6: error: unreported exception IOException; must be caught or declared to be thrown
    String count = new String(in.readLine());
                                         ^
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown
      String num = new String(in.readLine());
                                         ^
2 errors
Language: Java

import java.util.*;

class PrimeNum {
	public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		while(in.hasNext()){
			ar.add(sc.nextInt());
		}
		int size = ar.size() - 1;
		for(int i = 0;i < size;i++){
			int num = ar.get(i);
			if(num == 2){
				cnt++;
			}
			for(int j = 2;j < num;j++){
				if(num % j == 0){
					break;
				}else if(num - j == 1){
					cnt++;
				}
			}
		}
		System.out.println("PrimeNumber = "+cnt);
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		while(in.hasNext()){
		      ^
  symbol:   variable in
  location: class PrimeNum
1 error
Language: Java

import java.util.*;

class Main {
	public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextInt()){
			ar.add(sc.nextInt());
		}
		int size = ar.size() - 1;
		for(int i = 0;i <= size;i++){
			int num = ar.get(i);
			if(num == 2){
				cnt++;
			}
			double d = 0;
			for(int j = 2;j < d;j++){
				d = Math.ceil(num / 2)
				if(num % j == 0){
					break;
				}else if(num - j == d){
					cnt++;
				}
				
			}
		}
		System.out.println(cnt);
	}
}

Compiler output:
Main.java:19: error: ';' expected
				d = Math.ceil(num / 2)
				                      ^
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		int i, size, count = 0;
		List<Integer> numbers = new ArrayList<Integer>();

		Scanner in = new Scanner(System.in);
		
		size = Integer.parseInt(in.nextLine());
		for(i = 0; i < size; i++) numbers.add(Integer.parseInt(in.nextLine()));

		for(i = 0; i < size; i++){
			if(isPrime(numbers.get(i)) == true) count++;
		}
		System.out.println(count);
		}
	
	private static boolean isPrime(int number){
		int i;
		int route = (int)Math.sqrt(number);
		if(number == 1) return false;
		for(i = 2; i < route; i++){
			if(number % i == 0) return false;
		}
		return true;	
	}

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

import java.io.*;

class Main
{
 
  public static void main(String[] args)
  {
    try{
    	// ??\???????????????
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      // ????????°???????????????
      int n = Integer.parseInt(br.readLine());
      int[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){5
      System.out.println(e);
    }
  }
 
  public static int getPrimeNumber(int array[]){
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0){
			  isPrime = false;
		  }
		  else{
			//for(int j = 3;j <= Math.sqrt(array[i]);j += 2)
			  for(int j = 1;j <= array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime)total++;
	  }
	  return total;
  }
}

Compiler output:
Main.java:23: error: not a statement
    }catch(Exception e){5
                        ^
Main.java:23: error: ';' expected
    }catch(Exception e){5
                         ^
2 errors
Language: Java

mport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
/**
 *
 * @author Y
 */
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        int a;
        int c = 0;
        
        for(int i=0 ; i<N; i++){
            a = Integer.parseInt(br.readLine());
      
            for(int j = 2;j<=a-1;j++){
                if(a%j == 0) break; 
                if(j == a-1) c++;
            }
            
        }
        System.out.println(c);
        
        
        
    }
}

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;
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Scanner;
^
4 errors
Language: Java

import java.util.Scanner;
 
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int max = 100000001;
		int [] sosuu = new boolean [max];
		int [] n = new int [10000];
		int count = 0;
 
		for (int i = 1; i <= max - 1; i++) {
			sosuu[i] = 1;
		}
		sosuu[0] = 0;
		sosuu[1] = 0;
 
		for (int i = 2; i <= Math.sqrt(max); i++) {
			if (sosuu[i] == 1) {
				for (int j = i + i; j <= max - 1; j += i) {
					sosuu[j] = 0;
				}
			}
 
		}
 
		Scanner cin = new Scanner (System.in);
		int x = cin.nextInt();
 
		for (int i = 0; i < x; i++) {
			n[i] = cin.nextInt();
			if (sosuu[n[i]] == 1) count++;
		}
 
		System.out.println(count);
	}
 
	//private static void sosuulist() {
	//	
	//}
}

Compiler output:
Main.java:8: error: incompatible types: boolean[] cannot be converted to int[]
		int [] sosuu = new boolean [max];
		               ^
1 error
Language: Java

import java.util.Scanner;
 
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		int max = 100000001;
		boolean [] sosuu = new boolean [max];
		int [] n = new int [10000];
		int count = 0;
 
		for (int i = 1; i <= max - 1; i++) {
			sosuu[i] = 1;
		}
		sosuu[0] = 0;
		sosuu[1] = 0;
 
		for (int i = 2; i <= Math.sqrt(max); i++) {
			if (sosuu[i] == 1) {
				for (int j = i + i; j <= max - 1; j += i) {
					sosuu[j] = 0;
				}
			}
 
		}
 
		Scanner cin = new Scanner (System.in);
		int x = cin.nextInt();
 
		for (int i = 0; i < x; i++) {
			n[i] = cin.nextInt();
			if (sosuu[n[i]] == 1) count++;
		}
 
		System.out.println(count);
	}
 
	//private static void sosuulist() {
	//	
	//}
}

Compiler output:
Main.java:13: error: incompatible types: int cannot be converted to boolean
			sosuu[i] = 1;
			           ^
Main.java:15: error: incompatible types: int cannot be converted to boolean
		sosuu[0] = 0;
		           ^
Main.java:16: error: incompatible types: int cannot be converted to boolean
		sosuu[1] = 0;
		           ^
Main.java:19: error: incomparable types: boolean and int
			if (sosuu[i] == 1) {
			             ^
Main.java:21: error: incompatible types: int cannot be converted to boolean
					sosuu[j] = 0;
					           ^
Main.java:32: error: incomparable types: boolean and int
			if (sosuu[n[i]] == 1) count++;
			                ^
6 errors
Language: Java

public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int input = scan.nextInt();
		int[] num = new int[input];
		boolean t;
		int count = 0;
		
		for(int i = 0; i < input; i++){
			num[i] = scan.nextInt();
			
			if(isPrime(num[i])) {
				count++;
			}
		}
		
		System.out.println(count);
	}
	
	static boolean isPrime(int x){
		if(x <= 1) return false;
		
		for(int i = 2; i < x - 1; i++){
			if(x % i == 0){
				return false;
			}
		}
		return true;
	}
}

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)
Main.java:29: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        long idx=Integer.parseInt(buf.readLine()); 
        int ans=0;
        for(int i=0; i<idx;i++){
           long x=Integer.parseInt(buf.readLine());
           if(Prime(x)) ans++;
        }
        System.out.println(ans);
    }
    static boolean Prime(int x){
            if(x<2) return false;
            if(x==2) return true;
            else if(x%2==0) return false;
    for(int i=3;i<x;i+=2){
        if(x%i==0) return false;
        }
        return true;
    }   
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
           if(Prime(x)) ans++;
                    ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error