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

#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<queue>

using namespace std;

bool judge(const int x,const char str[]){
	
	char ans[10];
	
	if(x%3 ==0 && x%5 == 0)
		strcpy(ans,"FizzBuzz");
	else if(x%3==0)
		strcpy(ans,"Fizz");
	else if(x%5==0)
		strcpy(ans,"Buzz");
	else
		sprintf(ans,"%d",x);
	
	/*
	cout << "judge" << endl;
	cout << "-" << str << "-" << endl;
	cout << "-" << ans << "-" << endl;
	*/
	if( strcmp(ans,str) )return false;
	
	return true;
}

int main(void){
	int m,n;
	while(scanf("%d%d", &m, &n) && m != 0 && n != 0){
		
		queue<int> Q;
		char str[10];
		vector<int> ans;
		/*
		if(judge(1,"1\0") )
			cout << "true" << endl;
		else 
			cout << "false" << endl;
		*/
		for(int i = 1; i <= m; i++)
			Q.push(i);
		
		for(int i = 1; i <= n; i++){
	//		cout << "top" << Q.front() << endl;
			scanf("%s", str);
			if( judge(i,str) ){
//				cout << "³" << endl;
				Q.push(Q.front());
				Q.pop();
			}else{
				Q.pop();
			}
		}
		while(!Q.empty()){
			ans.push_back(Q.front());
			Q.pop();
		}
		sort(ans.begin(),ans.end());
		for(int i = 0; i < ans.size(); i++){
			printf("%d%s",ans[i],i==ans.size()-1?"\n":" ");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool judge(int, const char*)':
a.cc:14:17: error: 'strcpy' was not declared in this scope
   14 |                 strcpy(ans,"FizzBuzz");
      |                 ^~~~~~
a.cc:6:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<queue>
  +++ |+#include <cstring>
    6 | 
a.cc:16:17: error: 'strcpy' was not declared in this scope
   16 |                 strcpy(ans,"Fizz");
      |                 ^~~~~~
a.cc:16:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:18:17: error: 'strcpy' was not declared in this scope
   18 |                 strcpy(ans,"Buzz");
      |                 ^~~~~~
a.cc:18:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:27:13: error: 'strcmp' was not declared in this scope
   27 |         if( strcmp(ans,str) )return false;
      |             ^~~~~~
a.cc:27:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:63:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   63 |                 sort(ans.begin(),ans.end());
      |                 ^~~~
      |                 short
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>

using namespace std;

bool judge(const int x,const char str[]){
	
	char ans[10];
	
	if(x%3 ==0 && x%5 == 0)
		strcpy(ans,"FizzBuzz");
	else if(x%3==0)
		strcpy(ans,"Fizz");
	else if(x%5==0)
		strcpy(ans,"Buzz");
	else
		sprintf(ans,"%d",x);
	
	/*
	cout << "judge" << endl;
	cout << "-" << str << "-" << endl;
	cout << "-" << ans << "-" << endl;
	*/
	if( strcmp(ans,str) )return false;
	
	return true;
}

int main(void){
	int m,n;
	while(scanf("%d%d", &m, &n) && m != 0 && n != 0){
		
		queue<int> Q;
		char str[10];
		vector<int> ans;
		/*
		if(judge(1,"1\0") )
			cout << "true" << endl;
		else 
			cout << "false" << endl;
		*/
		for(int i = 1; i <= m; i++)
			Q.push(i);
		
		for(int i = 1; i <= n; i++){
	//		cout << "top" << Q.front() << endl;
			scanf("%s", str);
			if( judge(i,str) ){
//				cout << "³" << endl;
				Q.push(Q.front());
				Q.pop();
			}else{
				Q.pop();
			}
		}
		while(!Q.empty()){
			ans.push_back(Q.front());
			Q.pop();
		}
		sort(ans.begin(),ans.end());
		for(int i = 0; i < ans.size(); i++){
			printf("%d%s",ans[i],i==ans.size()-1?"\n":" ");
		}
	}
	return 0;
}

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

#include <stdio.h>
#include <string.h>
void get_correct(int i,char buf[16])
{
    if(i % 3 == 0 )
    {
        if(i% 5 == 0)
        {
            strcpy(buf,"FizzBuzz");
            return;
        }
        strcpy(buf,"Fizz");
        return;
    }
    if(i%5==0)
    {
        strcpy(buf,"Buzz");
        return;
    }
    sprintf(buf,"%d",i);
}
int main(void)
{
    int m,n;
    int pcnt;
    while(scanf("%d%d",&m,&n),m!=0 || n!=0)
    {
        int player[1000];
        pcnt=m;
        for(int i=0;i<m;i++)
        {
            player[i]=1;//参加中
        }
        int cur=0;
        for(int i=1;i<=n;)
        {
            //if(pcnt==1)
            if(player[cur]==0)//skipped
            {
                cur++;
                cur%=m;
                continue;
            }
            char str[16];
            scanf("%*[ \n]%15[^\n]",str);
            char correct[16];
            get_correct(i,correct);
            //printf("answer=\"%s\"\n",correct);
            if(strcmp(str,correct) != 0)
            {
                player[cur]=0;
                pcnt--;
            }
            else
            {
                //printf("correct");
            }
            cur++;
            cur%=m;
            i++;
        }
        for(int i=0; i<m;i++)
        {
            if(player[i])
                printf("%d%s",i+1,i==m-1?""," ");
            if(i==m-1)puts("");
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:48: error: expected ':' before ')' token
   65 |                 printf("%d%s",i+1,i==m-1?""," ");
      |                                                ^
      |                                                :
a.cc:65:48: error: expected primary-expression before ')' token
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<cstring>
#include<stdlib>

using namespace std;

bool mem[1001];

bool FizzBuzz(int a,string str){
	if(str=="FizzBuzz"){
		if(a%15==0)return true;
		else return false;
	}
	else if(str=="Fizz"){
		if(a%3==0)return true;
		else return false;
	}
	else if(str=="Buzz"){
		if(a%5==0)return true;
		else return false;
	}
	else{
		const char* ss=str.c_str();
		int s=atoi(ss);
		if(s==a && a%3!=0 && a%5!=0)return true;
		else return false;
	}
}

int main(void){
	while(1){
		int a,b,m,n;
		vector<string> str;
		cin >> m >> n;
		if(m==0 && n==0)break;
		fill(mem,mem+m,true);
		
		for(a=1;a<=n;a++){
			string s;
			cin >> s;
			str.push_back(s);
		}
		int j=1;
		for(a=1;a<=n;a++){
			if(!FizzBuzz(a,str[a]))mem[j]=false;
			bool ch=true;
			int jj=j;
			while(ch){
				if(j<m)j++;
				else j=1;
				if(jj=j)break;
				if(mem[j]==true)ch=false;
			}
			if(ch==true)break;
		}
		bool nyu=false;
		for(a=1;a<=m;a++){
			if(mem[a]==true){
				if(nyu==true)printf(" %d",a);
				else printf("%d",a);
				nyu=true;
			}
		}
		cout << endl;
	}
	return 0;
}

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

#include <iostream>
#include <cstring>
#include <cstdlib>

using namespace std;

int main(){
  int m , n;
  while(cin >> m >> n , m + n){
    int p = 1;
    int p_num = m;
    bool exist[1001];
    memset(exist,true,sizeof(exist));
    
    for(int i=1; i<=n; i++){
      string com; cin >> com;
      bool ok = i%3 != 0 && i%5 != 0 ?
	atoi(com.c_str()) == i :
	(i%3 == 0 && com == "Fizz") ||
	(i%5 == 0 && com == "Buzz") ||
	(i%15 == 0 && com == "FizzBuzz");
      
      if(!ok){
	exist[p] = false;
	p_num--;
      }
      if(p_num == 1) break;
      do{
	if(++p > m) p = 1;
      }	while(!exist[p]);
    }

    int i = 1;
    for(i <= m; i++){
      if(exist[i]) cout << i;
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:20: error: expected ';' before ')' token
   34 |     for(i <= m; i++){
      |                    ^
      |                    ;
Language: C++

while 1:
        n = map(int,raw_input().split())
        if n[0] == n[1] == 0:
                break
        m, o = [1 for x in range(n[0])], 0

        for x in range(1,n[1]+1):
                a = raw_input()
                if sum(m) == 1:
                        pass
                elif x % 15 == 0:
                        if a != "FizzBuzz":
                                m[o] = 0
                elif x % 3 == 0:
                        if a != "Fizz":
                                m[o] = 0
                elif x % 5 == 0:
                        if a != "Buzz":
                                m[o] = 0
                else:
                        if a != str(x):
                                m[o] = 0
                while 1:
                        o += 1
                        if sum(m) == 1:
                                break
                        elif o == len(m):
                                o = -1
                        elif m[o] == 1:
                                break

        for x in range(n[0]):
                if m[x] == 1:
                        print x+1,
        print ""

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

while 1:
  m, n = map(int, raw_input().split())
  if not m:
    break
  p = range(m)
  t = 0
  for i in range(1, n + 1):
    s = raw_input()
    if(i % 15 == 0 and s != "FizzBuzz" or
       i % 5 == 0 and s != "Buzz" or
       i % 3 == 0 and s != "Fizz" or
       i % 3 and i % 5 and s != str(i)):
      p.pop(t)
    else:
      t = (t + 1) % len(p)
  for i in range(len(p) - 1):
    print p[i] + 1,
  print p[len(p) - 1] + 1

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

void solve()
{
	int m, n;
	while(cin >> m >> n, m || n)
	{
		int count = m;
		bool flag[10002];
		memset(flag, 1, sizeof(flag));
		string ans = "";
		for(int i = 1; i <= n; ++i)
		{
			string speak;
			cin >> speak;
			if(i % 15 == 0)
			{
				if(speak != "FizzBuzz")
				{
					flag[i % m == 0 ? i % m + m : i % m] = false;
					--count;
				}
			}
			else if(i % 3 == 0)
			{
				if(speak != "Fizz")
				{
					flag[i % m == 0 ? i % m + m : i % m] = false;
					--count;
				}
			}
			else if(i % 5 == 0)
			{
				if(speak != "Buzz")
				{
					flag[i % m == 0 ? i % m + m : i % m] = false;
					--count;
				}
			}
			if(count == 1)
			{
				for(int j = 1; j <= m; ++j)
				{
					if(flag[j])
					{
						cout << j << endl;
						goto END;
					}
				}
			}
		}
		int end_pos = m;
		for(int i = m; i >= 1; --i)
		{
			if(flag[i])
			{
				end_pos = i;
				break;
			}
		}
		for(int i = 1; i < end_pos; ++i)
		{
			if(flag[i])
			{
				cout << i << " ";
			}
		}
		cout << end_pos << endl;
END:
		;
	}
}

int main()
{
	solve();
	return(0);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(flag, 1, sizeof(flag));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:72:1: error: jump to label 'END'
   72 | END:
      | ^~~
a.cc:50:54: note:   from here
   50 |                                                 goto END;
      |                                                      ^~~
a.cc:55:21: note:   crosses initialization of 'int end_pos'
   55 |                 int end_pos = m;
      |                     ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <cctype>

using namespace std;

bool check(int turn, string str, int player)
{
  if(turn%3 == 0 && turn%5 == 0){
    return str == "FizzBuzz";
  } else if(turn%3 == 0){
    return str == "Fizz";
  } else if(turn%5 == 0){
    return str == "Buzz";
  }

  return all_of(str.begin(), str.end(), isdigit) && atoi(str.c_str()) == turn;
}

int main()
{
  int n, m;
  string str;

  while(cin>>m>>n && n+m){
    queue<int> players;

    for(int i = 1; i <= m; ++i)
      players.push(i);

    for(int i = 1; i <= n; ++i){
      cin >> str;

      int player = players.front();
      players.pop();

      if(check(i, str, player)){
	players.push(player);
      }
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'bool check(int, std::string, int)':
a.cc:19:16: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   19 |   return all_of(str.begin(), str.end(), isdigit) && atoi(str.c_str()) == turn;
      |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:19:16: note:   couldn't deduce template parameter '_Predicate'
   19 |   return all_of(str.begin(), str.end(), isdigit) && atoi(str.c_str()) == turn;
      |          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided
Language: C++


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

int m,n;
char talk[1024],num[200];

int main(){
	int i;
	while( cin >> m >> n ){
		int kill[1000] = {0};
		int man = 0;
		if( m == 0 && n == 0 )
			break;
		for( i = 1;i <= n;i++ ){
			cin >> talk;
			if( i % 15 == 0 )
				strcpy( num,"FizzBuzz" );
			else if( i % 5 == 0 )
				strcpy( num,"Buzz" );
			else if( i % 3 == 0 )
				strcpy( num,"Fizz" );
			else
				itoa( i,num,10 );
			if( strcmp( talk,num ) != 0 ){
				kill[ man ] = 1;
			}

			int cnt = 0;
			do{
				man++;
				man %= m;
				cnt++;
			}while( kill[ man ] && cnt < m );
			if( cnt == m )
				break;
		}

		int maxsur;
		for( i = m-1;i >= 0;i-- ){
			if( kill[i] == 0 ){
				maxsur = i;
				break;
			}
		}
		for( i = 0;i <= maxsur;i++ ){
			if( kill[i] == 0 ){
				cout << i+1;
				if( i < maxsur ){
					cout << " ";
				}
				else{
					cout << endl;
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'itoa' was not declared in this scope
   25 |                                 itoa( i,num,10 );
      |                                 ^~~~
Language: Java

//配列に入れたらTime Limit Exceededでした.
//直しても直してもTime Limit Exceededですよー!

import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);

    static boolean[] prime = new boolean[10000001];

    public static void main(String[] args){

	prepare();

	while(true){
	    int n = kbd.nextInt();
	    if(n==0) break;
	    solve(n);
	}
    }

    static void prepare(){
	prime[0] = prime[1] = false;
	int i=2;
	for(; i<prime.length; i++){
	    prime[i] = prime(i);   
	}
    }

    static void solve(int n){

	while(!(prime[m] && prime[m-2] && prime[m-6] && prime[m-8])){
	    n--;
	}
	System.out.println(n);
    }
    static boolean prime(int a){
	int k = (int)Math.sqrt(a);
	for(int i=2; i<=k; i++){
	    if(a%i == 0) return false;
	}
	return true;
    }
}

Compiler output:
Main.java:31: error: cannot find symbol
	while(!(prime[m] && prime[m-2] && prime[m-6] && prime[m-8])){
	              ^
  symbol:   variable m
  location: class Main
Main.java:31: error: cannot find symbol
	while(!(prime[m] && prime[m-2] && prime[m-6] && prime[m-8])){
	                          ^
  symbol:   variable m
  location: class Main
Main.java:31: error: cannot find symbol
	while(!(prime[m] && prime[m-2] && prime[m-6] && prime[m-8])){
	                                        ^
  symbol:   variable m
  location: class Main
Main.java:31: error: cannot find symbol
	while(!(prime[m] && prime[m-2] && prime[m-6] && prime[m-8])){
	                                                      ^
  symbol:   variable m
  location: class Main
4 errors
Language: Java

package springstudy;
import java.util.*;
public class Primenumber {
	static final int max=100000;
	public static void main(String[] args) {
		//*ここから
		boolean prime[] = new boolean[max+1];
		for(int i=0;i<max;i++)prime[i]=true;
		prime[1]=false;
		for(int i=2;i<max;i++){
			if(prime[i]){
				for(int s=i*2;s<=max;s+=i)prime[s]=false;
			}
		}
		//*//ここまでエラトステネスの篩
		Scanner n = new Scanner(System.in);
		while(true){
			int in = n.nextInt();
			if(in==0)break;
			for(int i=in;i>0;i--){
	            if(prime[i]==true&&prime[i-8]==true&&prime[i-6]==true&&prime[i-2]){
	            	System.out.println(i);
	                break;
	            }
	        }

		}
	}
}

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

import java.util.Arrays;
import java.util.Scanner;

public class Main2 {
	static int MAX=10000001;
	static boolean[] is=new boolean[MAX];
	static{
		Arrays.fill(is,true);
		is[0]=is[1]=false;
		for(int i=2;i*i<=is.length;i++){
			if(is[i]){
				for(int j=i+i;j<is.length;j+=i){
					is[j]=false;
				}
			}
		}
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		for(;;){
			int n=cin.nextInt();
			if(n==0)break;
			if(n%2==0)n--;
			for(int i=n;i>=13;i-=2){
				if(is[i]){
					if(is[i-2]&&is[i-6]&&is[i-8]){
						System.out.println(i);
						break;
					}
				}
			}

		}
	}

}

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

import java.util.*;

public class p0222{
    private static final int mx = 10000000;

    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);

	int n;
	boolean[] prime = (new boolean[mx]);
	Arrays.fill(prime, true);
	prime[0] = prime[1] = false;

	for(int i = 2; i < mx; ++i)
	    if(prime[i])
		for(int j = i+i; j < mx; j+=i)
		    prime[j] = false;
	
	while(sc.hasNext()){
	    n = sc.nextInt();
	    if(n == 0) break;

	    for(int i = n; i >= 13; --i)
		if(prime[i-8] && prime[i-6] && prime[i-2] && prime[i]){
		    System.out.println(i);
		    break;
		}
	}
    }
}

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

#include<stdio.h>

int main(void)
{
    int i,j,n;
    char prime[10000001];

    for(i = 0;i <= 10000000;i++){
prime[i]='1';
}

    for(i = 2;i <= 10000000;i++){
if(prime[i]){
for(j=i+i;j<=10000000;j+=i){
prime[j]='0';
}
}
}

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

        if(n%2==0){
n--;
}

        for(i=n;i>=13;i-=2){
            if(prime[i]=='1'&&prime[i-2]=='1'&&prime[i-6]=='1'&&prime[i-8]=='1') {
                break;
            }   
        }   

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

    }   }
    return (0);
}

Compiler output:
main.c:35:5: error: expected identifier or '(' before 'return'
   35 |     return (0);
      |     ^~~~~~
main.c:36:1: error: expected identifier or '(' before '}' token
   36 | }
      | ^
Language: C

#include<stdio.h>
#define M 10000000
char p[M]={1,1};
int main(){
  int i,j,n;
  for(i=2;i*i<M;i++){
    if(p[i])continue;
    for(j=i*i;j<M;j+=i)p[j]=1;
  }
  while(scanf("%d",&n),n){
    for(;1;n--){
      if(p[n-8]+p[n-6]+p[n-2]+p[n]==0)break;
    }
    printf("%d\n",n);

Compiler output:
main.c: In function 'main':
main.c:14:5: error: expected declaration or statement at end of input
   14 |     printf("%d\n",n);
      |     ^~~~~~
main.c:14:5: error: expected declaration or statement at end of input
Language: C

include<stdio.h>
#include<math.h>
#define N 10000000

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

	return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |                 scanf("%d", &c[p][0]);
      |                 ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | #define N 10000000
main.c:13:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |                 scanf("%d", &c[p][0]);
      |                 ^~~~~
main.c:13:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:34:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |                 printf("%d\n", c[i][1]);
      |                 ^~~~~~
main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

include<stdio.h>
#include<math.h>
#define N 1000000

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

	return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |                 scanf("%d", &c[p][0]);
      |                 ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | #define N 1000000
main.c:13:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |                 scanf("%d", &c[p][0]);
      |                 ^~~~~
main.c:13:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:34:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   34 |                 printf("%d\n", c[i][1]);
      |                 ^~~~~~
main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:34:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<math.h>
#define N 10000000

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:34: error: subscripted value is neither array nor pointer nor vector
   14 |                 scanf("%d", &c[p][0]);
      |                                  ^
main.c:15:24: error: subscripted value is neither array nor pointer nor vector
   15 |                 if(c[p][0]!=0)p++;
      |                        ^
Language: C

#include<stdio.h>
#include<math.h>
#define N 10000000

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:13: error: 'new' undeclared (first use in this function)
   11 |         a = new int[N];
      |             ^~~
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:16: error: expected ';' before 'int'
   11 |         a = new int[N];
      |                ^~~~
      |                ;
main.c:36:9: error: 'delete' undeclared (first use in this function)
   36 |         delete[] a;
      |         ^~~~~~
main.c:36:16: error: expected expression before ']' token
   36 |         delete[] a;
      |                ^
Language: C

N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:9: warning: multi-character character constant [-Wmultichar]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |         ^~~~~~
main.c:1:7: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |       ^
main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |                 ^~~~
main.c: In function 'main':
main.c:1:17: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:1:78: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |                                                                              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
main.c:1:78: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |                                                                              ^~~~~
main.c:1:78: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:96: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | N=1e7,a['aaaa'];main(i,j){for(i=j=2;i*i<N;a[i]||j>N?j=++i:a[j+=i]++);for(;i=~scanf("%d",&N);N&&printf("%d\n",N))for(;a[N]+a[N-2]+a[N-6]+a[N-8]&&N--;);}
      |                                                                                                ^~~~~~
main.c:1:96: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:96: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:96: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C


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

public class Main {

	int INF = 1 << 28;
	final int N = 10000001;
	boolean prime[];
	LinkedList<Integer> maxp;
	int[] p4;
	
	void run() {
		Scanner sc = new Scanner(System.in);
		prime = new boolean[N];
		maxp = new LinkedList<Integer>();
		prime();
		for(;;) {
			int val = sc.nextInt();
			if(val == 0) break;
			int l = 0; int r = p4.length-1;
			while(l<=r) {
				int c = (l + r) / 2;
				if( p4[c] < val ) l = c+1;
				else if(p4[c] > val) r = c-1;
				else {
					l = c;
					break;
				}
			}
//			debug(p4);
			if(l>p4.length-1)System.out.println(p4[r]);
			else if(r<0) System.out.println(p4[l]);
			else System.out.println(min(p4[l],p4[r]));
		}
		
	}
	
	void prime() {
		prime[0] = prime[1] = true;
		for(int i=2;i<N;i++) if(!prime[i]){
			if(i-8>=0 && (!prime[i-8] && !prime[i-6] && !prime[i-2])) {
				maxp.add(i);
//				debug(i);
			}
			for(int j=i*2;j<N;j+=i) prime[j] = true;
		}
		p4 = new int[maxp.size()];
		int size = maxp.size();
		for(int i=0;i<size;i++) p4[i] = maxp.removeFirst();
		
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

Compiler output:
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:3:7: error: expected ';' before 'static'
    3 | import static java.lang.Math.*;
      |       ^~~~~~~
      |       ;
main.c:3:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import static java.lang.Math.*;
      |                   ^
main.c:4:7: error: expected ';' before 'static'
    4 | import static java.util.Arrays.*;
      |       ^~~~~~~
      |       ;
main.c:4:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | import static java.util.Arrays.*;
      |                   ^
main.c:6:1: error: unknown type name 'public'
    6 | public class Main {
      | ^~~~~~
main.c:6:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    6 | public class Main {
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int prime(int x) {
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (int i = 3; i*i <=x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
int main() {
	int x;
	while (cin>>x)) {
		for(int i=x; i>=13; i--){
			if (prime(i) && prime(i - 2) && prime(i - 6) && prime(i - 8)) {
				printf("%d\n",i);
              	break;
            }
        }
    }
  	 return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected primary-expression before ')' token
   14 |         while (cin>>x)) {
      |                       ^
Language: C++

public class Main{
  static int N = 10000001;
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int[] p;
    int pn, i, n, a;

    p = new int[N / 6];
    pn = getprime(p);

    for(;;){
      n = sc.nextInt();
      if(n == 0)break;
      a = 13;
      for(i = 6;p[i] <= n && i < pn;i++){
        if(p[i] - p[i-1] == 2 && p[i] - p[i-2] == 6 && p[i] - p[i-3] == 8){
          a = p[i];
        }
      }
      out.println(a);
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
  private static int getprime(int[] p){
    int i, j, count = 0;
    boolean[] e;
    e = new boolean[N];
    e[0] = true; e[1] = true;
    for(i = 2;i < N;i++)if(!e[i]){
      p[count++] = i;
      for(j = i * 2;j < N;j+=i)e[j] = true;
    }
    return count;
  }
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main{
      | ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
vector<int> prime;
void sieve(int n){
  vector<bool> is_prime(n, 1);
  prime.push_back(1);
  for (int i = 2; i <= n; i++) {
    if(is_prime[i] == false)continue;
    prime.push_back(i);
    for (int j = i; j <= n; j+=i) is_prime[j] = false;
  }
}

int main(int argc, char *argv[]){
  sieve((int)1e7 + 100);
  int n;
  while(std::cin >> n, n){
    int start = upper_bound(prime.begin(), prime.end(), n) -
      prime.begin();
    start--;
    // std::cout << "n:" << n << std::endl;
    // std::cout << "start:" << start << std::endl;
    // std::cout << "prime:" << prime[start] << std::endl;
    for (int i = start; i >= 0; i--) {
      int a = prime[i];
      if(prime[i - 1] == a - 2 &&
         prime[i - 2] == a - 6 &&
         prime[i - 3] == a - 8){
        std::cout << prime[i] << std::endl;
        break;
      }
    }
    //std::cout << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:19:17: error: 'upper_bound' was not declared in this scope
   19 |     int start = upper_bound(prime.begin(), prime.end(), n) -
      |                 ^~~~~~~~~~~
Language: C++

#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

vector<bool> dp, searched;

bool is_prime(int n)
{
	if (searched[n])
	{
		return dp[n];
	}

	return isprime(n, 2);
}

bool isprime(int n, int k)
{
	if (n < k * k)
	{
		searched[n] = true;
		
		dp[n] = true;
		
		return true;
	}

	if (n % k == 0)
	{
		searched[n] = true;
		
		dp[n] = false;
		
		return false;
	}

	if (k > 2)
	{
		return is_prime(n, k + 2);
	}

	return is_prime(n, k + 1);
}

int main()
{
	int N;

	dp = searched = vector<bool>(10000001, false);

	while (true)
	{
		cin >> N;

		if (N == 0) { break; }

		int Ans = 1145141919;

		if (N % 2 == 0)
		{
			N -= 1;
		}

		for (int i = N; ; i -= 2)
		{
			if (is_prime(i - 8) && is_prime(i - 6) && is_prime(i - 2) && is_prime(i))
			{
				Ans = i; break;
			}
		}
		
		cout << Ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:16:16: error: 'isprime' was not declared in this scope; did you mean 'is_prime'?
   16 |         return isprime(n, 2);
      |                ^~~~~~~
      |                is_prime
a.cc: In function 'bool isprime(int, int)':
a.cc:41:32: error: too many arguments to function 'bool is_prime(int)'
   41 |                 return is_prime(n, k + 2);
      |                        ~~~~~~~~^~~~~~~~~~
a.cc:9:6: note: declared here
    9 | bool is_prime(int n)
      |      ^~~~~~~~
a.cc:44:24: error: too many arguments to function 'bool is_prime(int)'
   44 |         return is_prime(n, k + 1);
      |                ~~~~~~~~^~~~~~~~~~
a.cc:9:6: note: declared here
    9 | bool is_prime(int n)
      |      ^~~~~~~~
Language: C++

#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

vector<bool> dp, searched;

bool is_prime(int n)
{
	if (searched[n])
	{
		return dp[n];
	}

	return isprime(n, 2);
}

bool isprime(int n, int k)
{
	if (n < k * k)
	{
		searched[n] = true;
		
		dp[n] = true;
		
		return true;
	}

	if (n % k == 0)
	{
		searched[n] = true;
		
		dp[n] = false;
		
		return false;
	}

	if (k > 2)
	{
		return isprime(n, k + 2);
	}

	return isprime(n, k + 1);
}

int main()
{
	int N;

	dp = searched = vector<bool>(10000001, false);

	while (true)
	{
		cin >> N;

		if (N == 0) { break; }

		int Ans = 1145141919;

		if (N % 2 == 0)
		{
			N -= 1;
		}

		for (int i = N; ; i -= 2)
		{
			if (is_prime(i - 8) && is_prime(i - 6) && is_prime(i - 2) && is_prime(i))
			{
				Ans = i; break;
			}
		}
		
		cout << Ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:16:16: error: 'isprime' was not declared in this scope; did you mean 'is_prime'?
   16 |         return isprime(n, 2);
      |                ^~~~~~~
      |                is_prime
Language: C++

#include <iostream>
using namespace std;

int main(){
	int x=100000;
	bool isPrime[x];
	isPrime[0]=isPrime[1]=false;
	for(int i=2; i<x; i++)
		isPrime[i]=true;
	
	for(int i=2; i*i<x; i++){
		if(isPrime[i]){
			for(int j=i*i; j<x;j+=i)
				isPrime[j]=false;
		}
	}
	
	int n;
	int ans=0;
	while(true){
		cin >> n;
		if(n==0)
			break;
	
		for(int i=0; i<=n; i++){
				if(isPrime[i]){
					if(isPrime[i-2]){
						if(isPrime[i-6]){
							if(isPrime[i-8])
								ans=i;
						}
					}
				}
			}	
		
	cout << ans << endl;
	}
	
	

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

#include <iostream>
using namespace std;

bool isPrime(int n){

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

int main(){
	
	int n;
	int ans;
	while(true){
		ans=0;
		cin >> n;
		if(n==0)
			break;
		
		int i=n;
		while(i>=13){
				if(isPrime(i)&&isPrime(i-2)&&isPrime(i-6)&&isPrime(i-8))
								ans=i;
				if(ans!=0)
					break;
				i--;
				
			}	
		
	cout << ans << endl;
	}
	
	

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

#include<iostream>
using namespace std;
int main(){
	int n, count=0;
	int temp = 0;
	int maxn = 0;
	int sosuu[3] = { 0 };
	cin >> n;
	while (n != 0){
		for (int i = 2; i <= n - 8; i++){
			for (int l = 2; l < i; l++){
				if (i%l == 0) count++;
			}
			if (count == 0) {
				temp = i;
				sosuu[0] = temp + 2;
				sosuu[1] = temp + 6;
				sosuu[2] = temp + 8;
				if (sosuu[2]>maxn){
					for (int i1 = 0; i1 < 3; i1++){
						for (int l1 = 2; l1 < sosuu[i1]; l1++){
							if (sosuu[i1] % l1 == 0) count++;
						}if (count != 0) break;
					}if (count == 0){
						if (maxn < sosuu[2]) maxn = sosuu[2];
					}
				}
			}
			count = 0;
		}
		cout << maxn << endl;
		cin >> n;
	}

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

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"

bool isso(long long int a) {
	if (a == 1 || a == 0)return false;
	for (long long int i = 2; i*i <= a; ++i) {
		if ((a%i)) {
		}
		else {
			return false;
		}
	}
	return true;
}
int main() {
	while (1) {
		int N; cin >> N;
		if (!N)break;
		int num = N;
		while (num % 6 != 1)num--;
		while (1) {
			if (isso(num) && isso(num - 2) && isso(num - 6) && isso(num - 8)) {
				cout << num << endl;
				break;
			}
			num-=6;
		}
		mp.clear();

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'mp' was not declared in this scope
   37 |                 mp.clear();
      |                 ^~
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"

long long int powmod(long long int a, long long int b, const int mod) {
	assert(b >= 0);
	if (b == 0)return 1;
	if (b == 1)return a;
	long long int ans = 1;
	long long int aa = powmod(a, b / 2, mod);
	ans *= aa*aa;
	ans %= mod;
	if (b % 2)ans *= a;
	ans %= mod;
	return ans;
}

const int k = 12;
//?´???°??????
bool mirror_rabin(const long long int n) {
	if (a == 1 || a == 0)return false;
	for (long long int i = 2; i*i <= a; ++i) {
		if ((a%i)) {
		}
		else {
			return false;
		}
	}
	return true;
}
bool isso(long long int a) {
	if (a == 1 || a == 0)return false;
	for (long long int i = 2; i*i <= a; ++i) {
		if ((a%i)) {
		}
		else {
			return false;
		}
	}
	return true;
}


int main() {
	while (1) {
		int N; cin >> N;
		if (!N)break;
		int num = N;
		if (num < 19) {
			cout << 13 << endl;
		}
		else {
			while (num % 30 != 19)num--;
			while (1) {
				if (mirror_rabin(num) && mirror_rabin(num - 2) && mirror_rabin(num - 6) && mirror_rabin(num - 8)) {
					cout << num << endl;
					break;
				}
				num -= 30;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool mirror_rabin(long long int)':
a.cc:29:13: error: 'a' was not declared in this scope
   29 |         if (a == 1 || a == 0)return false;
      |             ^
a.cc:30:42: error: 'a' was not declared in this scope
   30 |         for (long long int i = 2; i*i <= a; ++i) {
      |                                          ^
Language: C++

#include <stdio.h>

int prime(int);

int main()
{
	int n, sw;

	scanf("%d", &n);
	while (n > 0) {
		sw = 0;
		while (sw == 0) {
			if (prime(n) > 0) {
				if (prime(n-2) > 0) {
					if (prime(n-6) > 0) {
						if (prime(n-8) > 0)
							sw = 1;
					}
				}
			}
			if (sw > 0)
				break;
			else
				n--;
		}
		printf("%d\n", n);

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

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccLX2eHT.o: in function `main':
a.cc:(.text+0x37): undefined reference to `prime(int)'
/usr/bin/ld: a.cc:(.text+0x4d): undefined reference to `prime(int)'
/usr/bin/ld: a.cc:(.text+0x63): undefined reference to `prime(int)'
/usr/bin/ld: a.cc:(.text+0x79): undefined reference to `prime(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

void prime(bool is_prime[]){
	is_prime[0]=is_prime[1]=false;
	for(int i=2; i<1000000; i++){
		is_prime[i]=true;
	}

	for(int i=2; i*i<1000000; i++){
		if(is_prime[i]){
			for(int j=i*i; j<1000000; j+=i){
				is_prime[j]=false;
			}
		}
	}
};

int main(){
	bool is_prime[1000000];

	prime(is_prime);

	}
	while(true){
		int a;
		cin>>a;
		if(a==0)
			break;

		int ans=0;
		for(int i=a; i>=13; i--){
			if(is_prime[i]){
				if(is_prime[i-2]){
					if(is_prime[i-6]){
						if(is_prime[i-8]){
							ans=i;
							break;
						}
					}
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc:25:9: error: expected unqualified-id before 'while'
   25 |         while(true){
      |         ^~~~~
a.cc:46:9: error: expected unqualified-id before 'return'
   46 |         return 0;
      |         ^~~~~~
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
	bool is_prime[10000001];
	
	is_prime[0]=is_prime[1]=false;
	
	for(int i=2;i<10000001;i++){
		is_prime[i]=true;
	}
	
	for(int i=2;i*i<100000011;i++){
		if(is_prime[i]){
			for(int j=i*i;j<10000001j+=i){
				is_prime[j]=false;
			}
		}
	}
	
	while(true){
		int n;
		cin>>n;
		
		if(n==0)
			break;
			
		for(int i=n;i>12;i--){
			if(is_prime[i]&&is_prime[i-2]&&is_prime[i-6]&&is_prime[i-8]){
				cout<<i<<endl;
				break;
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: invalid operands of types 'int' and '__complex__ int' to binary 'operator<'
   16 |                         for(int j=i*i;j<10000001j+=i){
      |                                       ~^~~~~~~~~~
      |                                       | |
      |                                       | __complex__ int
      |                                       int
a.cc:16:53: error: expected ';' before ')' token
   16 |                         for(int j=i*i;j<10000001j+=i){
      |                                                     ^
      |                                                     ;
Language: C++


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define INF (1<<20)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

ll n;
ll arr[10000010],ans[10000010];

void Eratosthenes() {
	for (ll i = 0; i <= 10000010; i++)arr[i] = 1;
	
	for (ll i = 2; i <= sqrt(10000010); i++) {
		if (arr[i]) {
			for (ll j = 0; i*(j + 2) <= 10000010; j++)
				arr[i*(j + 2)] = 0;
		}
	}

	ll pre_prime = 0;
	for (ll i = 13; i <= 10000010; i++) {
		if (arr[i] && arr[i-2] && arr[i-6] && arr[i-8]) {
			ans[i] = i;
			pre_prime = i;
		}
		else ans[i] = pre_prime;
	}
}

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<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define INF (1<<20)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

ll arr[10000010];

void Eratosthenes() {
	memset(arr, 1, sizeof(arr));
	
	for (ll i = 2; i <= sqrt(10000010); i++) {
		if (arr[i]) {
			for (ll j = 0; i*(j + 2) <= 10000010; j++)
				arr[i*(j + 2)] = 0;
		}
	}

}

int main()
{
	int n;
	Eratosthenes();
	while (cin >> n, n) {
		int i = n;
		while (!(arr[i] && arr[i - 2] && arr[i - 6] && arr[i - 8]))i--;
		cout << i << endl;
	}
	return	0;
}

Compiler output:
a.cc: In function 'void Eratosthenes()':
a.cc:31:9: error: 'memset' was not declared in this scope
   31 |         memset(arr, 1, sizeof(arr));
      |         ^~~~~~
a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include<iterator>
  +++ |+#include <cstring>
   16 |
Language: C++

#define MAX 10000000
int  p[MAX];
int  four[1000];
int main(void)
{
  int i,j,f=0;
  //ツ倍ツ青板づーツ渉慊外
  for(i=2 ; i<=MAX/2 ; i++){
      for(j=2 ; i*j<=MAX ; j++){
	if(p[i*j] == 0)
	  p[i*j] = 1;
      }
  }

  for(i=3 ; i < MAX-7 ; i+=2){
    if(p[i] == 0 && p[i+2]==0 && p[i+6]==0 && p[i+8]==0)
      {
	four[f++]=i+8;
	//	printf("%d\n",i+8);
      }
  }
  
  for(;scanf("%d",&j),j;)
    {
      for(i=0 ;four[i]<=j; i++);
      printf("%d\n",four[i-1]);
    }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'scanf' was not declared in this scope
   23 |   for(;scanf("%d",&j),j;)
      |        ^~~~~
a.cc:26:7: error: 'printf' was not declared in this scope
   26 |       printf("%d\n",four[i-1]);
      |       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define MAX 10000000