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

#include<iostream>
#include<algorithm>

using namespace std;

void koukan(int*,int*,int,int );

int n,m;

void main(){
	while(1){
		int goukei=0,goukei_t=0;
		cin>>n>>m;
		if(!n&&!m)	break;

		int *taro=new int[n];
		int *hanako=new int [m];
		for(int i=0;i<n;i++){
			cin>>taro[i];
			goukei+=taro[i];
			goukei_t+=taro[i];
		}
		for(int j=0;j<m;j++){
			cin>>hanako[j];
			goukei+=hanako[j];
		}
		if(goukei%2==1){
			delete[] hanako;
			delete[]taro;
			cout<<-1<<endl;
			continue;
		}
		goukei/=2;
		koukan(taro,hanako,goukei,goukei_t);
		delete[] hanako;
		delete[] taro;
	}
	return;
}
void koukan(int *taro,int *hanako,int goukei,int tarou_mix){
	int mix=1000000;
	int cnt=0;
	pair<int,int> p[100];
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++){
			if((tarou_mix-taro[i]+hanako[j])==goukei){
				if(mix>(taro[i]+hanako[j])){
					mix=taro[i]+hanako[j];
					p[cnt].first=taro[i];
					p[cnt].second=hanako[j];
					cnt++;
					
				}
			}
		}
	if(cnt){
		cout<<p[cnt-1].first<<" "<<p[cnt-1].second<<endl;
		return;
	}
	cout<<-1<<endl;
}

Compiler output:
a.cc:10:1: error: '::main' must return 'int'
   10 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:38:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   38 |         return;
      |         ^~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>

#define REP(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define ALLOF(c) c.begin(), c.end()
#define RANGEOF(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-9
#define INF 1000000000
using namespace std;

template <class T> T read() { T t; cin >> t; return t; }
template <class T> vector<T> read(int n) { vector<T> v; REP(i,n) { v.push_back(read<T>()); } return v; }
template <class T> vector<vector<T>> read(int n, int m)
{
	vector<vector<T>> v;
	REP(i,n) { v.push_back(read<T>(m)); }
	return v;
}

template <class T> void write(const T &t) { cout << t << endl; }
template <class T> void write(const T &t, const T &t2) { cout << t << ' ' << t2 << endl; }
template <class T> void write(const vector<T> &v)
{
	ostringstream ss; 
	for (auto x : v) ss << v[i] << ' ';
	auto s = ss.str();
	cout << s.substr(0, s.length() - 1) << endl;
}

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__

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

/// template end ///

void solve()
{
	while (true)
	{
		READ(int, n, m);
		if (!n && !m) { break; }

		auto taro = read<int>(n);
		auto hana = read<int>(m);

		int ret = INF, tr = 0, hr = 0;
		auto tx = accumulate(ALLOF(taro), 0);
		auto hx = accumulate(ALLOF(hana), 0);
		for (auto t:taro) for (auto h:hana)
		{
			if (tx - t + h == hx - h + t && ret > t + h)
			{
				ret = t + h;
				tr = t;
				hr = h;
			}
		}
		if (ret == INF) { write(-1); }
		else { write(tr, hr); }
	}
}

Compiler output:
a.cc: In function 'void write(const std::vector<_Tp>&)':
a.cc:35:34: error: 'i' was not declared in this scope
   35 |         for (auto x : v) ss << v[i] << ' ';
      |                                  ^
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

int main(int argc, char const* argv[])
{
  while (true) {
    int n, m;
    std::cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    std::vector<int> taro(n);
    std::vector<int> hanako(m);
    for (int i = 0; i < n; ++i)
      std::cin >> taro[i];
    for (int i = 0; i < m; ++i)
      std::cin >> hanako[i];
    std::sort(taro.begin(), taro.end());
    std::sort(hanako.begin(), hanako.begin());
    int taro_score = std::accumulate(taro.begin(), taro.end(), 0);
    int hanako_score = std::accumulate(hanako.begin(), hanako.end(), 0);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        int x = taro[i], y = hanako[j];
        if (taro_score - x + y == hanako_score - y + x) {
          std::cout << x << " " << y << std::endl;
          goto finish;
        }
      }
    }
    std::cout << "-1" << std::endl;
finish:
    1+1;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   18 |     std::sort(taro.begin(), taro.end());
      |          ^~~~
      |          qsort
a.cc:19:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   19 |     std::sort(hanako.begin(), hanako.begin());
      |          ^~~~
      |          qsort
Language: Java

import java.util.Scanner;

public class Main {
	
	static boolean[] isPrime = new boolean[300001];
	
	static void prime(int n) {
		for(int i=2; i*n<300000; i++) {
			isPrime[n*i] = false;
		}
	}
	
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			int[] numprime = new int[300000];
			int k = 0;
			for(int i=2; i<300000; i++) {
				isPrime[i] = true;
			}
			for(int i=2; i<300000; i++) {
				if(isPrime[i]) {
					if(i%7 == 1 || i%7 == 6) {
						numprime[k] = i;
						k++;
						prime(i);
					}
					else {
						isPrime[i] = false; 
					}
				}
			}
			
			while(sc.hasNext()) {
				int N = sc.nextInt();
				if(N == 1) break;
				
				int cnt = 0;
				for(int i=0; i<k; i++) {
					if(numprime[i] <= N && N % numprime[i] == 0) {
						if(cnt == 0) {
							System.out.printf("%d: %d", N, numprime[i]);
							cnt++;
						}
						else {
							System.out.printf(" %d", numprime[i]);
						}
					}
				}
				System.out.println();
			}
		}
	}
}v


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by S64 on 15/07/28.
 */

// ????§?: 2??????32???36?§?
// ??????: 1??????49???16?§??????????

class Main {

    static final List<Integer> msNumbers;
    static final List<Integer> msPrimes;

    static {
        {
            // 7??§?????£????????????1?????????6??§????????£??´??°
            msNumbers = new ArrayList<>();
            for(int i = 2; i < 300000; i++) {
                int x = i % 7;
                if(x == 1 || x == 6)
                    msNumbers.add(i);
            }
        }
        {
            // ?????????????´???°??§?????????????????????a???b??????????????????????´???°??§????????°????????????
            // 1????????§????????????????????°??§??????????????¨1??????????????????????´???°?????????????????????
            // (????´???°?????¨??????????????´??°????????????????????¨?????§????????´??°????????¨)
            msPrimes = new ArrayList<>();
            for(int num : msNumbers) {
                boolean isPrime = true;
                for(int prime : msPrimes) {
                    if(num % prime == 0)
                        isPrime = false;
                }
                if(isPrime)
                    msPrimes.add(num);
            }
        }
    }

    // ??\???????????????????????????????????°??????????????? ???????????????????´??????°????????????????????????????????°??????
    public static void main(String _[]) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        while(true) {
            int number = Integer.parseInt(in.readLine());
            if(number <= 1)
                break;
            List<String> results = new ArrayList<>();
            for(int prime : msPrimes) {
                if(number % prime == 0)
                    results.add( String.valueOf(prime) );
            }
            System.out.println( String.format("%d: %s", number, String.join(" ", results) ) );
        }
    }

}

Compiler output:
Main.java:47: error: as of release 9, '_' is a keyword, and may not be used as an identifier
    public static void main(String _[]) throws IOException {
                                   ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by S64 on 15/07/28.
 */

// ????§?: 2??????32???36?§?
// ??????: 1??????49???16?§??????????

class Main {

    static final List<Integer> msNumbers;
    static final List<Integer> msPrimes;

    static {
        {
            // 7??§?????£????????????1?????????6??§????????£??´??°
            msNumbers = new ArrayList<Integer>();
            for(int i = 2; i < 300000; i++) {
                int x = i % 7;
                if(x == 1 || x == 6)
                    msNumbers.add(i);
            }
        }
        {
            // ?????????????´???°??§?????????????????????a???b??????????????????????´???°??§????????°????????????
            // 1????????§????????????????????°??§??????????????¨1??????????????????????´???°?????????????????????
            // (????´???°?????¨??????????????´??°????????????????????¨?????§????????´??°????????¨)
            msPrimes = new ArrayList<Integer>();
            for(int num : msNumbers) {
                boolean isPrime = true;
                for(int prime : msPrimes) {
                    if(num % prime == 0)
                        isPrime = false;
                }
                if(isPrime)
                    msPrimes.add(num);
            }
        }
    }

    // ??\???????????????????????????????????°??????????????? ???????????????????´??????°????????????????????????????????°??????
    public static void main(String _[]) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        while(true) {
            int number = Integer.parseInt(in.readLine());
            if(number <= 1)
                break;
            List<String> results = new ArrayList<>();
            for(int prime : msPrimes) {
                if(number % prime == 0)
                    results.add( String.valueOf(prime) );
            }
            System.out.println( String.format("%d: %s", number, String.join(" ", results) ) );
        }
    }

}

Compiler output:
Main.java:47: error: as of release 9, '_' is a keyword, and may not be used as an identifier
    public static void main(String _[]) throws IOException {
                                   ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by S64 on 15/07/28.
 */

// ????§?: 2??????32???36?§?
// ??????: 1??????49???16?§??????????

class Main {

    static final List<Integer> msNumbers;
    static final List<Integer> msPrimes;

    static {
        {
            // 7??§?????£????????????1?????????6??§????????£??´??°
            msNumbers = new ArrayList<Integer>();
            for(int i = 2; i < 300000; i++) {
                int x = i % 7;
                if(x == 1 || x == 6)
                    msNumbers.add(i);
            }
        }
        {
            // ?????????????´???°??§?????????????????????a???b??????????????????????´???°??§????????°????????????
            // 1????????§????????????????????°??§??????????????¨1??????????????????????´???°?????????????????????
            // (????´???°?????¨??????????????´??°????????????????????¨?????§????????´??°????????¨)
            msPrimes = new ArrayList<Integer>();
            for(int num : msNumbers) {
                boolean isPrime = true;
                for(int prime : msPrimes) {
                    if(num % prime == 0)
                        isPrime = false;
                }
                if(isPrime)
                    msPrimes.add(num);
            }
        }
    }

    // ??\???????????????????????????????????°??????????????? ???????????????????´??????°????????????????????????????????°??????
    public static void main(String _[]) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        while(true) {
            int number = Integer.parseInt(in.readLine());
            if(number <= 1)
                break;
            List<String> results = new ArrayList<String>();
            for(int prime : msPrimes) {
                if(number % prime == 0)
                    results.add( String.valueOf(prime) );
            }
            System.out.println( String.format("%d: %s", number, String.join(" ", results) ) );
        }
    }

}

Compiler output:
Main.java:47: error: as of release 9, '_' is a keyword, and may not be used as an identifier
    public static void main(String _[]) throws IOException {
                                   ^
1 error
Language: Java

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

public class B {
	public void run() {
		Scanner sc = new Scanner(System.in);

		boolean[] p = new boolean[300000];
		boolean[] ms = new boolean[300000];
		for (int i = 0; i < ms.length; i++) {
			ms[i] = ((i % 7 == 1) || (i % 7 == 6));
			p[i] = ms[i];
		}
		for (int i = 2; i < ms.length; i++) {
			if (p[i]) {
				for (int j = i + i; j < ms.length; j += i) {
					p[j] = false;
				}
			}
		}

		for (;;) {
			int n = sc.nextInt();
			if (n == 1) {
				break;
			}
			System.out.print(n + ":");
			for (int i = 2; i <= n; i++) {
				if (!p[i])
					continue;
				if (n % i == 0) {
					System.out.print(" " + i);
				}
			}
			System.out.println();
		}

	}

	public static void main(String[] Aregs) {
		B a = new B();
		a.run();
	}
}

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

import java.util.*;

public class AOJ_1154{
    void run(){
        int MAX = 300000;
        Scanner sc = new Scanner(System.in);
        boolean[] is_MS_Prime = new boolean[MAX+1];
        Arrays.fill(is_MS_Prime, true);
        is_MS_Prime[0] = is_MS_Prime[1] = false;
        for(int i = 0; i <= MAX; i++){
            if(!is_MS_Prime[i]){
                continue;
            }
            if(i % 7 != 1 && i % 7 != 6){
                is_MS_Prime[i] = false;
            }
            else{
                for(int ii = i + i; ii <= MAX; ii += i){
                    is_MS_Prime[ii] = false;
                }
            }
        }
        //System.out.println(Arrays.toString(is_MS_Prime));
        while(true){
            int n = sc.nextInt();
            if(n == 1){
                break;
            }
            String ans = n + ":";
            for(int i = 6; i <= n; i++){
                if(is_MS_Prime[i] && n % i == 0){
                    ans = ans + " " + i;
                }
            }
            System.out.println(ans);
        }
    }
    public static void main(String[] args){
        new AOJ_1154().run();
    }
}

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

import java.util.ArrayList;
import java.util.Scanner;

public class no2 {
	static Scanner stdIn= new Scanner(System.in);
	static ArrayList<Integer> smPrime = new ArrayList<Integer>();

	public static void main(String args[]){
		while(true){
			int input = stdIn.nextInt();
			if(input==1)
				break;
			func(input);
		}
	}
	static public void func(int in){
		ArrayList<Integer> ans = new ArrayList<Integer>();
		if(isPrime(in)){
			ans.add(in);
		}
		else{
			int tmp = in;
			if(in % 7 == 1){
				tmp=in-2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
			while(tmp>6){
				tmp-=5;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
				tmp-=2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
		}
		System.out.print(in+": ");
		for(int i=0;i<ans.size();i++){
			System.out.print(ans.get(i)+" ");
		}
		System.out.println();
	}
	private static boolean isPrime(int i) {
		for(int j=0;j<smPrime.size();j++){
			if(i==smPrime.get(j)){
//				System.out.println("222");

				return true;
			}
		}
		int tmp=i;
		if(i % 7 == 1){
			tmp=i-2;
			if(i % tmp == 0 ){
	//			System.out.println("001");

				return false;
				}
		}
		while(tmp>6){
			tmp-=5;
			if(i % tmp == 0 )
			{
		//		System.out.println("002");

				return false;
				}
			tmp-=2;
			if(i % tmp == 0 )
			{
			//	System.out.println("003");

				return false;
				}

		}
		smPrime.add(i);
		//System.out.println("!!!!");
		return true;
	}
}

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

import java.util.ArrayList;
import java.util.Scanner;
public class no2 {
	static Scanner stdIn= new Scanner(System.in);
	static ArrayList<Integer> smPrime = new ArrayList<Integer>();
	public static void main(String args[]){
		while(true){
			int input = stdIn.nextInt();
			if(input==1)
				break;
			func(input);
		}
	}
	static public void func(int in){
		ArrayList<Integer> ans = new ArrayList<Integer>();
		if(isPrime(in)){
			ans.add(in);
		}
		else{
			int tmp = in;
			if(in % 7 == 1){
				tmp=in-2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
			while(tmp>6){
				tmp-=5;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
				tmp-=2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
		}
		System.out.print(in+": ");
		for(int i=0;i<ans.size();i++){
			System.out.print(ans.get(i)+" ");
		}
		System.out.println();
	}
	private static boolean isPrime(int i) {
		for(int j=0;j<smPrime.size();j++){
			if(i==smPrime.get(j)){

				return true;
			}
		}
		int tmp=i;
		if(i % 7 == 1){
			tmp=i-2;
			if(i % tmp == 0 ){
				return false;
				}
		}
		while(tmp>6){
			tmp-=5;
			if(i % tmp == 0 )
			{
				return false;
				}
			tmp-=2;
			if(i % tmp == 0 )
			{

				return false;
				}

		}
		smPrime.add(i);
		return true;
	}
}

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

import java.util.ArrayList;
import java.util.Scanner;
public class MAIN {
	static Scanner stdIn= new Scanner(System.in);
	static ArrayList<Integer> smPrime = new ArrayList<Integer>();
	public static void main(String args[]){
		while(true){
			int input = stdIn.nextInt();
			if(input==1)
				break;
			func(input);
		}
	}
	static public void func(int in){
		ArrayList<Integer> ans = new ArrayList<Integer>();
		if(isPrime(in)){
			ans.add(in);
		}
		else{
			int tmp = in;
			if(in % 7 == 1){
				tmp=in-2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
			while(tmp>6){
				tmp-=5;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
				tmp-=2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
		}
		System.out.print(in+": ");
		for(int i=0;i<ans.size();i++){
			System.out.print(ans.get(i)+" ");
		}
		System.out.println();
	}
	private static boolean isPrime(int i) {
		for(int j=0;j<smPrime.size();j++){
			if(i==smPrime.get(j)){

				return true;
			}
		}
		int tmp=i;
		if(i % 7 == 1){
			tmp=i-2;
			if(i % tmp == 0 ){
				return false;
				}
		}
		while(tmp>6){
			tmp-=5;
			if(i % tmp == 0 )
			{
				return false;
				}
			tmp-=2;
			if(i % tmp == 0 )
			{

				return false;
				}

		}
		smPrime.add(i);
		return true;
	}
}

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

import java.util.ArrayList;
import java.util.Scanner;

public class no2 {
	static Scanner stdIn= new Scanner(System.in);
	static ArrayList<Integer> smPrime = new ArrayList<Integer>();

	public static void main(String args[]){
		while(true){
			int input = stdIn.nextInt();
			if(input==1)
				break;
			func(input);
		}
	}
	static public void func(int in){
		ArrayList<Integer> ans = new ArrayList<Integer>();
		if(isPrime(in)){
			ans.add(in);
		}
		else{
			int tmp = in;
			if(in % 7 == 1){
				tmp=in-2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
			while(tmp>6){
				tmp-=5;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
				tmp-=2;
				if(in % tmp == 0 ){
					if(isPrime(in/tmp)){
						ans.add(in/tmp);
					}
				}
			}
		}
		System.out.print(in+":");
		for(int i=0;i<ans.size();i++){
			System.out.print(" "+ans.get(i));
		}
		System.out.println();
	}
	private static boolean isPrime(int i) {
		for(int j=0;j<smPrime.size();j++){
			if(i==smPrime.get(j)){
//				System.out.println("222");

				return true;
			}
		}
		int tmp=i;
		if(i % 7 == 1){
			tmp=i-2;
			if(i % tmp == 0 ){
	//			System.out.println("001");

				return false;
				}
		}
		while(tmp>6){
			tmp-=5;
			if(i % tmp == 0 )
			{
		//		System.out.println("002");

				return false;
				}
			tmp-=2;
			if(i % tmp == 0 )
			{
			//	System.out.println("003");

				return false;
				}

		}
		smPrime.add(i);
		//System.out.println("!!!!");
		return true;
	}
}

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

import java.util.ArrayList;
import java.util.Scanner;

public class no2 {
	static Scanner stdIn= new Scanner(System.in);
//	static ArrayList<Integer> smPrime = new ArrayList<Integer>();

	public static void main(String args[]){
		while(true){
			int input = stdIn.nextInt();
			if(input==1)
				break;
			func(input);
		}
	}
	static public void func(int in){
		ArrayList<Integer> ans = new ArrayList<Integer>();
		if(isPrime(in)){
			ans.add(in);
		}
		else{
			int idxh=0,idxb=0;
			int tmp=6;
			while(tmp*tmp<=in){
				if(in % tmp == 0){
					if(isPrime(tmp)){
						ans.add(idxh++,tmp);
						System.out.println(tmp);
					}
					if(isPrime(in/tmp)){
						ans.add(ans.size()-(idxb++),in/tmp);
						System.out.println(in/tmp);
					}
				}
				tmp+=2;
				if(in % tmp == 0 && tmp*tmp<=in){
					if(isPrime(tmp)){
						ans.add(idxh++,tmp);
						System.out.println(tmp);
					}
					if(isPrime(in/tmp)){
						ans.add(ans.size()-(idxb++),in/tmp);
						System.out.println(in/tmp);
					}	
				}
				tmp+=5;
			}
		}
		System.out.print(in+":");
		for(int i=0;i<ans.size();i++){
			System.out.print(" "+ans.get(i));
		}
		System.out.println();
	}
	private static boolean isPrime(int i) {
		int tmp=6;
		while(tmp*tmp<=i){
			if(i % tmp == 0 )
			{
				return false;
				}
			tmp+=2;
			if(i % tmp == 0 )
			{
				return false;
				}

			tmp+=5;
		}
		return true;
	}
}

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

#include <stdio.h>
#define MAX 1000000

int main(void) {
  int n;
  int sosuu[MAX];
  int i, j;
  int getsuyou, doyou;
  int count = 0; // 素数の数

  sosuu[0] = 6;
  count++;
  
  for (i=1; i<42857; i++) { 
    // debug
    // printf("**%d**\n",i);

    getsuyou = i*7 +1;
    for (j=0; j<count; j++) {
      if (getsuyou % sosuu[j] == 0)
	break;
    }
    if (j == count) {
      sosuu[count++] = getsuyou;
    }

    doyou = i*7 + 6;
    for (j=0; j<count; j++) {
      if (doyou % sosuu[j] == 0)
	break;
    }
    if (j == count) {
      sosuu[count++] = doyou;
    }
  }

  // debug
  // for (j=0; j<count; j++)
  //  printf("%d ", sosuu[j]);
  // putchar('\n');
  
  // debug
  //printf("count:%d\n", count);
  

  while(scanf("%d", &n) == 1) 

    if (n == 1)
      break;

    

    printf("%d:", n);
    
    for (j=0; j<count; j++) {
      if (n < sosuu[j])
	break;

      if (n % sosuu[j] == 0)
	printf(" %d", sosuu[j]);
    }

    putchar('\n');
  }
  return 0;
  
}

Compiler output:
main.c:65:3: error: expected identifier or '(' before 'return'
   65 |   return 0;
      |   ^~~~~~
main.c:67:1: error: expected identifier or '(' before '}' token
   67 | }
      | ^
Language: C

#include <iostream>
#include <math.h>
using namespace std;
void prime(int n);
bool subprime(int n);
int main(){
	int n;
	while (true){
		cin >> n;
		if (n == 1){ break; }
		prime(n);
	}
	return 0;
}
void prime(int n){
	cout << n << ": ";
	int s = (int)sqrt(n);	//?????????
	int r = 0;
	int i = 6;
	while (i <= n){//6 8 13 15
		if (n%i == 0){
			if (subprime(i) == true){
				cout << i << " ";
			}
		}
		i += 2;
		if (n%i == 0){
			if (subprime(i) == true){
				cout << i << " ";
			}
		}
		i += 5;
	}
	cout << endl;
}
bool subprime(int n){
	int i = 6;
	bool r;
	while (i < n){//6 8 13 15
		if (n%i == 0){
			return false;
		}
		if (i % 7 == 6){ i += 2; }
		if (i == n){ break; }
		if (n%i == 0){
			return false;
		}
		if (i % 7 == 1){ i += 5; }
	}
	return true;
}

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

#include<Stdio.h>
#include<math.h>
#define MAX 300000

int main(){
	int i,j;
	int n;
	int board[MAX + 1];

	for(i = 0;i < MAX;i++){
		board[i] = (i % 7 == 1 || i % 7 == 6);
	}
	board[1] = 0;

	j = 6;
	while(j < MAX){
		for(i = 2 * j;i < MAX;i++)board[i] = 0;
		j++;
		while(!board[j]){
			if(j == MAX - 1)break;
			j++;
		}
		if(j == MAX - 1)j++;
	}
	
	while(scanf("%d",&n),n != 1){
		printf("%d:",n);
		for(i = 0;i < n;i++){
			if(board[i]){
				if(n % i == 0)printf(" %d",i);
			}
		}
		puts("");
	}
	return 0;
}

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

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

bool check(int arg){
    int count=0;
    for(int i=2;i*i<=arg;i++){
        if(arg%i==0){
            if(i%7==1 || i%7 == 6){
                count++;
            }
            if((arg/i)%7 == 1 || (arg/i)%7 == 6){
                count++;
            }
        }
        if(count>1) return false;
    }
    return true;
}

int main(){
    int n;
    while(cin >> n && n != 1){
        vector<int> v;
        for(int i=1;i*i<=n;i++){
            if(n%i==0){
                if(i%7 == 1 || i%7 == 6){
                    if(check(i) && i != 1 && i*i != n){
                        v.push_back(i);
                    }
                }
                if((n/i)%7 == 1 || (n/i)%7==6){
                    if(check(n/i)){
                        v.push_back(n/i);
                    }
                }
            }
        }
        sort(v.begin(), v.end());

        printf("%d:", n);
        for(int i=0;i<v.size();i++){
            printf(" %d", v[i]);
        }
        printf("\n");
    }
}

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

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-6;
const long INF = 1e10;


int main(){
	vector<long> sat,prime;
	
	FOR(i,2,300001)if(i%7==1||i%7==6)sat.PB(i);
	
	for(long i=0;i<SZ(sat);i++){
		bool flag=true;
		for(long j=0;sat[j]*sat[j]<=sat[i];j++)if(sat[i]%sat[j]==0)flag=false;
		if(flag)prime.PB(sat[i]);
	}
	long tmp;
	while(cin>>tmp){
		if(tmp==1)break;
		vector<long>res;
		REP(j,SZ(prime))if(tmp%prime[j]==0)res.PB(prime[j]);
		cout<<tmp<<":"
		REP(j,SZ(res))cout<<" "<<j;
		cout<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:31: error: expected ';' before 'for'
   89 |                 cout<<tmp<<":"
      |                               ^
      |                               ;
a.cc:90:21: error: 'j' was not declared in this scope; did you mean 'jn'?
   90 |                 REP(j,SZ(res))cout<<" "<<j;
      |                     ^
a.cc:61:35: note: in definition of macro 'FOR'
   61 | #define FOR(i,a,b) for(long i=(a);i<(b);++i)
      |                                   ^
a.cc:90:17: note: in expansion of macro 'REP'
   90 |                 REP(j,SZ(res))cout<<" "<<j;
      |                 ^~~
Language: C++

int isMonSatPrime(int cand){

	if (cand % 7 != 1 && cand % 7 != 6){
		return(0);
	}

	int limit = sqrt(cand);
	int i = 6;
	int next = MON;

	if (cand < 2){
		return(0);
	}

	while (i > 1){
		if (cand % i == 0){
			break;
		}

		if (next == SAT){
			i += 5;
			next = MON;
		}
		else if (next == MON){
			i += 2;
			next = SAT;
		}
	}

	if (i == (cand)){
		return(1);
	}
	else{
		return(0);
	}
}

int main()
{
	while (1){
		int num;
		scanf("%d", &num);
		if (num == 1){
			break;
		}

		int i = 6;
		int next = MON;
		while (i <= num){

			if (num%i == 0){
				if (isMonSatPrime(i) == 1){
					printf("%d ",i);
				}
			}

			if (next == SAT){
				i += 5;
				next = MON;
			}
			else if (next == MON){
				i += 2;
				next = SAT;
			}
		}
		puts("");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int isMonSatPrime(int)':
a.cc:7:21: error: 'sqrt' was not declared in this scope
    7 |         int limit = sqrt(cand);
      |                     ^~~~
a.cc:9:20: error: 'MON' was not declared in this scope
    9 |         int next = MON;
      |                    ^~~
a.cc:20:29: error: 'SAT' was not declared in this scope
   20 |                 if (next == SAT){
      |                             ^~~
a.cc: In function 'int main()':
a.cc:42:17: error: 'scanf' was not declared in this scope
   42 |                 scanf("%d", &num);
      |                 ^~~~~
a.cc:48:28: error: 'MON' was not declared in this scope
   48 |                 int next = MON;
      |                            ^~~
a.cc:53:41: error: 'printf' was not declared in this scope
   53 |                                         printf("%d ",i);
      |                                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int isMonSatPrime(int cand){
a.cc:57:37: error: 'SAT' was not declared in this scope
   57 |                         if (next == SAT){
      |                                     ^~~
a.cc:66:17: error: 'puts' was not declared in this scope
   66 |                 puts("");
      |                 ^~~~
Language: C++

#include<stdio.h>

int isMonSatPrime(int cand){

	if (cand % 7 != 1 && cand % 7 != 6){
		return(0);
	}

	int limit = sqrt(cand);
	int i = 6;
	int next = MON;

	if (cand < 2){
		return(0);
	}

	while (i > 1){
		if (cand % i == 0){
			break;
		}

		if (next == SAT){
			i += 5;
			next = MON;
		}
		else if (next == MON){
			i += 2;
			next = SAT;
		}
	}

	if (i == (cand)){
		return(1);
	}
	else{
		return(0);
	}
}

int main()
{
	while (1){
		int num;
		scanf("%d", &num);
		if (num == 1){
			break;
		}

		int i = 6;
		int next = MON;
		while (i <= num){

			if (num%i == 0){
				if (isMonSatPrime(i) == 1){
					printf("%d ",i);
				}
			}

			if (next == SAT){
				i += 5;
				next = MON;
			}
			else if (next == MON){
				i += 2;
				next = SAT;
			}
		}
		puts("");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int isMonSatPrime(int)':
a.cc:9:21: error: 'sqrt' was not declared in this scope
    9 |         int limit = sqrt(cand);
      |                     ^~~~
a.cc:11:20: error: 'MON' was not declared in this scope
   11 |         int next = MON;
      |                    ^~~
a.cc:22:29: error: 'SAT' was not declared in this scope
   22 |                 if (next == SAT){
      |                             ^~~
a.cc: In function 'int main()':
a.cc:50:28: error: 'MON' was not declared in this scope
   50 |                 int next = MON;
      |                            ^~~
a.cc:59:37: error: 'SAT' was not declared in this scope
   59 |                         if (next == SAT){
      |                                     ^~~
Language: C++

#include<stdio.h>
#define MON 1
#define SAT 6

int isMonSatPrime(int cand){

	if (cand % 7 != 1 && cand % 7 != 6){
		return(0);
	}

	int limit = sqrt(cand);
	int i = 6;
	int next = MON;

	if (cand < 2){
		return(0);
	}

	while (i > 1){
		if (cand % i == 0){
			break;
		}

		if (next == SAT){
			i += 5;
			next = MON;
		}
		else if (next == MON){
			i += 2;
			next = SAT;
		}
	}

	if (i == (cand)){
		return(1);
	}
	else{
		return(0);
	}
}

int main()
{
	while (1){
		int num;
		scanf("%d", &num);
		if (num == 1){
			break;
		}

		int i = 6;
		int next = MON;
		while (i <= num){

			if (num%i == 0){
				if (isMonSatPrime(i) == 1){
					printf("%d ",i);
				}
			}

			if (next == SAT){
				i += 5;
				next = MON;
			}
			else if (next == MON){
				i += 2;
				next = SAT;
			}
		}
		puts("");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int isMonSatPrime(int)':
a.cc:11:21: error: 'sqrt' was not declared in this scope
   11 |         int limit = sqrt(cand);
      |                     ^~~~
Language: C++

#include<iostream>
using namespace std; int a[500001], i, j, n;
int main() {
	for (i = 2; i < 500001; i++) {
		if (i % 7 == 1 || i % 7 == 6) {
			for (j = 2; j <= sqrt(i); j++) {
				if (a[j] == 1 && i%j==0) {
					a[i] = 0; goto E;
				}
			}
			a[i] = 1;
		E:;
		} 
	}
	while (true) {
		cin >> n;
		if (n < 2) { break; }printf("%d:", n);
		for (i = 2; i <= n;i++){
			if (a[i] == 1 && n%i == 0) { printf(" %d", i); }
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:42: error: 'sqrt' was not declared in this scope
    6 |                         for (j = 2; j <= sqrt(i); j++) {
      |                                          ^~~~
Language: C++

#include<algorithm>
using namespace std;int a[500001],i,j,n;
main(){
for(i=2;i<500001;i++){
if(i%7==1||i%7==6){
for(j=2;j<=sqrt(i);j++){
if(a[j]==1&&i%j==0){
a[i]=0;goto E;
}
}
a[i]=1;
E:;
} 
}
while(true){
cin>>n;
if(n<2){break;}printf("%d:",n);
for(i=2;i<=n;i++){
if(a[i]==1&&n%i==0){printf(" %d", i);}
}
cout<<endl;
}
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:12: error: 'sqrt' was not declared in this scope
    6 | for(j=2;j<=sqrt(i);j++){
      |            ^~~~
a.cc:16:1: error: 'cin' was not declared in this scope
   16 | cin>>n;
      | ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;int a[500001],i,j,n;
a.cc:17:16: error: 'printf' was not declared in this scope
   17 | if(n<2){break;}printf("%d:",n);
      |                ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include<algorithm>
  +++ |+#include <cstdio>
    2 | using namespace std;int a[500001],i,j,n;
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<endl;
      | ^~~~
a.cc:21:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:7: error: 'endl' was not declared in this scope
   21 | cout<<endl;
      |       ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;int a[500001],i,j,n;
Language: C++

#include <iostream>
using namespace std;
void prime(int n);
bool subprime(int n);
int main(){
	int n;
	while (true){
		cin >> n;
		if (n == 1){ break; }
		prime(n);
	}
	return 0;
}
void prime(int n){
	cout << n << ": ";
	int s = (int)sqrt(n);	//?????????
	int r = 0;
	int i = 6;
	while (i <= n){//6 8 13 15
		if (n%i == 0){
			if (subprime(i) == true){
				cout << i << " ";
			}
		}
		i += 2;
		if (n%i == 0){
			if (subprime(i) == true){
				cout << i << " ";
			}
		}
		i += 5;
	}
	cout << endl;
}
bool subprime(int n){
	int i = 6;
	bool r;
	while (i < n){//6 8 13 15
		if (n%i == 0){
			return false;
		}
		if (i % 7 == 6){ i += 2; }
		if (i == n){ break; }
		if (n%i == 0){
			return false;
		}
		if (i % 7 == 1){ i += 5; }
	}
	return true;
}

Compiler output:
a.cc: In function 'void prime(int)':
a.cc:16:22: error: 'sqrt' was not declared in this scope
   16 |         int s = (int)sqrt(n);   //?????????
      |                      ^~~~
Language: C++

lude <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
	int a[200000],c=0,n;
	r(i,3,300000)if(i%7==1||i%7==6){
		int p=1;if(i>10&&(i%6==0||i%8==0))continue;
		r(k,0,c)if(i%a[k]==0)p=0;
		if(p)a[c++]=i;
	}r(i,0,c)cout<<a[i]<<endl;
	while(cin>>n,n!=1){
		int s=0;
		cout<<n<<':';
		r(i,0,c)if(n%a[i]==0)cout<<' '<<a[i];
		cout<<endl;
	}
}

Compiler output:
a.cc:1:1: error: 'lude' does not name a type
    1 | lude <bits/stdc++.h>
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:18: error: 'cout' was not declared in this scope
   10 |         }r(i,0,c)cout<<a[i]<<endl;
      |                  ^~~~
a.cc:10:30: error: 'endl' was not declared in this scope
   10 |         }r(i,0,c)cout<<a[i]<<endl;
      |                              ^~~~
a.cc:11:15: error: 'cin' was not declared in this scope
   11 |         while(cin>>n,n!=1){
      |               ^~~
a.cc:13:17: error: 'cout' was not declared in this scope
   13 |                 cout<<n<<':';
      |                 ^~~~
a.cc:15:23: error: 'endl' was not declared in this scope
   15 |                 cout<<endl;
      |                       ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <math.h>

std::vector<int> ans;
std::vector<int> prime;

void calc( int n, int i ) {
	for ( int j = i; j < prime.size(); j++ ) {
		int m = prime[j];

		if ( !(n % m) ) {
			ans.push_back(m);
			calc(n/m, j);
		}
	}
}

int main()
{
	prime.push_back(6);
	for ( int i = 7; i <= 300000; i+=7 ) {
		for ( int j = -1; j < 2; j+=2 ) {
			int m = i + j;
			int k;
			int sq = sqrt(m);
			for ( k = 0; k < prime.size(); ++k ) {
				if (sq < prime[k]) { prime.push_back(m); break; }
				if (!(m % prime[k])) break;
			}
		}
	}
	while(true){
		int n;

		std::cin >> n;
		if ( n == 1 ) break;

		ans.clear();

		calc(n, 0);

		std::sort(ans.begin(), ans.end());
		ans.erase(std::unique(ans.begin(), ans.end()), ans.end());

		std::cout << n << ": ";
		for ( int i = 0; i < ans.size(); ++i ) {
			std::cout << ans[i] << ((i == ans.size()-1) ? "" : " ");
		}
		std::cout << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:22: error: 'sort' is not a member of 'std'; did you mean 'sqrt'?
   43 |                 std::sort(ans.begin(), ans.end());
      |                      ^~~~
      |                      sqrt
a.cc:44:32: error: 'unique' is not a member of 'std'
   44 |                 ans.erase(std::unique(ans.begin(), ans.end()), ans.end());
      |                                ^~~~~~
Language: C++

#include <iostream>
using namespace std;

bool is_msprime(int a) // a is ms number
{
  int j;

  j = 6;
  while (j * j <= a) {
    if (a % j == 0) return false;

    if (j % 7 == 1) {
      j = 7 *(j / 7) + 6;
    }
    else if (j % 7 == 6) j = 7 *(j / 7) + 8;
  }
  return a != 1;
}

int main() {
  int n;
  int i;

  cin >> n;
  while(n != 1) {
    cout << n << ": ";
    for (i = 1; ((7 * i - 1)*7 <= n)
           or ((7 * i + 1)*7 <= n); i++) {
      if (is_msprime(7  i - 1) && n % (7  i - 1) == 0) {
        cout << 7 * i - 1 << " ";
      }
      if (is_msprime(7  i + 1) && n % (7  i + 1) == 0) {
        cout << 7 * i + 1 << " ";
      }

    }
    if (is_msprime(n)) cout << n;
    cout << endl;
    cin >> n;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:23: error: expected ')' before 'i'
   29 |       if (is_msprime(7  i - 1) && n % (7  i - 1) == 0) {
      |                     ~ ^ ~
      |                       )
a.cc:29:41: error: expected ')' before 'i'
   29 |       if (is_msprime(7  i - 1) && n % (7  i - 1) == 0) {
      |                                       ~ ^ ~
      |                                         )
a.cc:31:8: error: expected ')' before 'if'
   31 |       }
      |        ^
      |        )
   32 |       if (is_msprime(7  i + 1) && n % (7  i + 1) == 0) {
      |       ~~
a.cc:29:10: note: to match this '('
   29 |       if (is_msprime(7  i - 1) && n % (7  i - 1) == 0) {
      |          ^
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	int prime[100000] = {};
	int pos = 0;
	bool flag = false;
	prime[1] = 6;
	pos = 2;
	for (int i = 8; i <= 300000; flag ? i += 5 : i += 2) {
		FOR(t, 1, pos-1) {
			if (i%prime[t] == 0) {
				break;
			}
			if (t == pos - 1) {
				prime[pos] = i;
				pos++;
			}
		}
		if (flag) {
			flag = false;
		}
		else {
			flag = true;
		}
	}

	while (1) {
		int n;

		cin >> n;
		if (n == 1) {
			break;
		}
		cout << n << ":";
		FOR(i, 1, pos - 1) {
			if(n%prime[i] == 0) {
				if (check) {
					cout << " " << prime[i];
				}
			}
		}
		cout << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:37: error: 'check' was not declared in this scope
   50 |                                 if (check) {
      |                                     ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>

#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define REP(i,k,n) for(int i = k; i < n; i++)

#define vi vector<int>
#define pb push_back
using namespace std;

const int MAX_N = 300010;
vi prime;
bool is_prime[MAX_N + 1];
void sieve(){
    memset(is_prime,false,sizeof(is_prime));
    for(int i = 1; i * 7 < MAX_N; i++) {
        int bef = i * 7 - 1;
        int aft = i * 7 + 1;
        is_prime[bef] = true;
        is_prime[aft] = true;
    }
    for(int i = 1; i * 7 <= MAX_N; i++) {
        int bef = i * 7 - 1;
        int aft = i * 7 + 1;
        if(is_prime[bef]) {
            for(int j = 2 * bef; j <= MAX_N; j += bef) is_prime[j] = false;
        }
        if(is_prime[aft]) {
            for(int j = 2 * aft; j <= MAX_N; j += aft) is_prime[j] = false;
        }
    }
    rep(i,MAX_N) if(is_prime[i]) prime.pb(i);
}

int main(){
    int n;
    sieve();
    while(cin >> n, n != 1) {
        cout << n << ":";
        rep(i,prime.size()){
            if(n % prime[i] == 0) cout << " " << prime[i];
        }
        cout << endl;
    }

    return 0;

}



Compiler output:
a.cc: In function 'void sieve()':
a.cc:19:5: error: 'memset' was not declared in this scope
   19 |     memset(is_prime,false,sizeof(is_prime));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cmath>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main(){
	
	int p[100000],k;
	memset(p,0,sizeof(p));
	p[0]=6;
	for(int i=1;i<100000;i++){
		if(i%2==0)k=i/2*7+6;
		else k=(i-1)/2*7+8;
		for(int j=0;j<100000;j++){
			if(p[j]==0){p[j]=k;break;}
			if(k%p[j]==0)break;
		}
	}
	int n;
	while(cin>>n,n!=1){
		cout<<n<<": ";
		for(int i=0;i<100000;i++){
			if(p[i]==0||p[i]>n)break;
			if(n%p[i]==0)cout<<p[i]<<" ";
		}
		cout<<endl;
	}
}

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

#include <iostream>

using namespace std;

int main(){
  bool prime[3e5];
  for(int i=6;i<3e5;i++){
    if (!(i%7-1)||!(i%7-6)){
      prime[i] = true;
      for(int j=1;j*j<=i;j++)
	if (((7*j-1)<i&&i%(7*j-1)==0)||((7*j+1)<i&&i%(7*j+1)==0))
	  prime[i] = false;
    }
    else
      prime[i] = false;
  }
  
  cout << << endl;
  int n;
  while(true){
    cin >>n;
    if (n==1)
      break;
    cout << n << ":";
    for(int i=1;7*i-1<=n;i++){
      if (prime[7*i-1]&&!(n%(7*i-1)))
	cout << 7*i-1 << " "; 
      if (prime[7*i+1]&&!(n%(7*i+1)))
	cout << 7*i+1 << " "; 
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 |   bool prime[3e5];
      |              ^~~
a.cc:6:14: error: could not convert '3.0e+5' from 'double' to 'long unsigned int'
    6 |   bool prime[3e5];
      |              ^~~
      |              |
      |              double
a.cc:6:14: error: size of array 'prime' has non-integral type 'double'
a.cc:18:11: error: expected primary-expression before '<<' token
   18 |   cout << << endl;
      |           ^~
Language: C++

#include<iostream>
#include<string.h>
#define MAX 300001

using namespace std;

bool prime[MAX]

int main(void){
	
	int n,p,num;
	
	p=0;
	memset(prime,true,sizeof(prime));
	
	for(int i=0;i<6;i++){
		prime[i]=false;
	}
	
	for(int i=2;i<=MAX;i++){
		for(int j=6*i;j<=MAX;j++){
			if(prime[i]){
				prime[j]=false;
			}	
		}
	}
	
	while(cin>>n){
		if(n==1){
			break;
		}
		cout<<n<<": ";
		for(int i=0;i<n;i++){
			if(prime[i]){
				if(0==(n%prime[i])){
					cout<<prime[i]<<" ";
				}
			}
		}
	}
}

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

#include<iostream>
#include<string.h>
#define MAX 300001

using namespace std;

bool prime[MAX];

int main(void){
	
	int n,p,num;
	
	p=0;
	memset(prime,true,sizeof(prime));
	
	for(int i=0;i<6;i++){
		prime[i]=false;
	}
	
	for(int i=2;i<=MAX;i++){
		for(int j=6*i;j<=MAX;j++){
			if(prime[i]){
				prime[j]=false;
			}	
		}
	}
	
	while(cin>>n){
		if(n==1){
			break;
		}
		cout<<n<<": ";
		for(int i=0;i<n;i++){
			if(prime[i] && 0==(n%prime[i]){
					cout<<prime[i]<<" ";
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:55: error: expected ')' before '{' token
   34 |                         if(prime[i] && 0==(n%prime[i]){
      |                           ~                           ^
      |                                                       )
a.cc:37:17: error: expected primary-expression before '}' token
   37 |                 }
      |                 ^