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

#include<stdio.h>
bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}

Compiler output:
main.c:2:1: error: unknown type name 'bool'
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}
main.c:2:25: error: expected ';', ',' or ')' before '=' token
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}
      |                         ^
main.c: In function 'main':
main.c:2:152: error: 'true' undeclared (first use in this function)
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}
      |                                                                                                                                                        ^~~~
main.c:2:152: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:2:152: note: each undeclared identifier is reported only once for each function it appears in
main.c:2:217: error: implicit declaration of function 'isprime' [-Wimplicit-function-declaration]
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){scanf("%d%d%d",&n,&d,&a);if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}printf("%d\n",a-d);}}
      |                                                                                                                                                                                                                         ^~~~~~~
Language: C

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define MAX 1000000

int main(){
  int a,d,c,sosu;;
  int m=0;
  int n=0;

  while(1){
  scanf("%d%d%d",&a,&d,&c);
  if(a==0&&d==0&&c==0){
    break;
  }

    for(a=a;a<MAX;a+=d){
      if(a==1){
        continue;
      }


      if(a==2){
        m++;
      }

      if(a%2!=0){
        for(sosu=3;sosu<=sqrt(a);sosu++){
          if(a%sosu==0){
            n++;
            break;
          }
        }
        if(pre==0){
          m++;
        }
      }
      n=0;
      if(m>=c){
        break;
      }
    }

  printf("%d\n",a);
  m=0;
}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:12: error: 'pre' undeclared (first use in this function)
   35 |         if(pre==0){
      |            ^~~
main.c:35:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
 
int Prime(int p){
  int i,f;
  f = 0;
  if(p == 1) return 0;
  if(p == 2) return 1;
  if(p % 2 == 0) return 0;
  for(i=3;i*i <= p;i += 2){
    if(p % i == 0) f = 1;
  }
 
  if(f == 0) return 1;
  else return 0;
}
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1) {
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:16: error: implicit declaration of function 'prime'; did you mean 'Prime'? [-Wimplicit-function-declaration]
   28 |             if(prime(i)) {
      |                ^~~~~
      |                Prime
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
 
int sosu(int i) {
    int k;
 
    if(i==1)
        return 0;
    if(i==2||i==3)
        return 1; 
    for(k=2;k<=sqrt(i);k++)
        if(i%k==0) return 0;
    return 1;
}
 
int main() {
 
    int a,d,n;
    int i,j;
 
    while(1){
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(j<n) {
            if(sosu(i)) {
                count++;
            }
            i+=d;
        }
        printf("%d\n",i-d);
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:9: error: 'count' undeclared (first use in this function)
   25 |         count=0,i=a;
      |         ^~~~~
main.c:25:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main() {
  long a, d, n;
  long i, j;
  int pri[1000000] = {};
  pri[2] = 1;
  pri[3] = 1;

  for(i = 5; i < 1000000; i+=2) {
    for(j = 3; j < i; j++){
      if(i % j == 0)
        break;
      if(i == j + 2)
        pri[i] = 1;
    }
  }

  while(1) {
    scanf("%ld %ld %ld", &a, &d, &n);
  //  if(a > 9307 || d > 346 || n > 210)
  //    scanf("%ld %ld %ld", &a, &d, &n);
    else if(a == 0 && d == 0 && n == 0)
      break;
    i = 0;

    do{
      if(pri[a] == 1)
        i++;
      if(i <= n)
        a += d;
    } while (i <= n);

    printf("%ld\n", a);
  }
}

Compiler output:
main.c: In function 'main':
main.c:23:5: error: 'else' without a previous 'if'
   23 |     else if(a == 0 && d == 0 && n == 0)
      |     ^~~~
Language: C

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

int main(void) {
    int s=1; int e=1; int d=1; int i; int m; bool result;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        result=true;
        m = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            i=3;
            while(i<sqrt(s) || result==true) {
                if(s%i == 0) {
                    result=false;
                }
                i++;
            }
            if(result=true)
                m++;
        }    
                
        while(m<e) {
            result=true;
            s+=d;
            
            if(s < 2) {
                i=3;
                while(i<sqrt(s) || result == true) {
                    if(s%i == 0) {
                        result = false;
                    }
                    i++;
                }
            }
            
            if(result = true)
                m++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
main.c: In function 'main':
main.c:5:46: error: unknown type name 'bool'
    5 |     int s=1; int e=1; int d=1; int i; int m; bool result;
      |                                              ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:12:16: error: 'true' undeclared (first use in this function)
   12 |         result=true;
      |                ^~~~
main.c:12:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:12:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:20: error: 'false' undeclared (first use in this function)
   16 |             result=false;
      |                    ^~~~~
main.c:16:20: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

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

int main(void) {
    int s=1; int e=1; int d=1; int i; int m;  result;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        result=true;
        m = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            i=3;
            while(i<sqrt(s) || result==true) {
                if(s%i == 0) {
                    result=false;
                }
                i++;
            }
            if(result=true)
                m++;
        }    
                
        while(m<e) {
            result=true;
            s+=d;
            
            if(s < 2) {
                i=3;
                while(i<sqrt(s) || result == true) {
                    if(s%i == 0) {
                        result = false;
                    }
                    i++;
                }
            }
            
            if(result = true)
                m++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
main.c: In function 'main':
main.c:6:47: error: 'result' undeclared (first use in this function)
    6 |     int s=1; int e=1; int d=1; int i; int m;  result;
      |                                               ^~~~~~
main.c:6:47: note: each undeclared identifier is reported only once for each function it appears in
Language: C

//#define DEBUG
using namespace std;

bool prime[1000000] = {0};
int a, d, n;

int main(){
	for(int i = 2; i < 1000; i++){
		if(!prime[i]){
			for(int j = i*2; j < 1000000; j+=i){
				prime[j] = true;
			}
		}
	}
	prime[0] = prime [1] = 1;
	#ifdef DEBUG_prime
	for(int i = 2; i < 100; i++)if(!prime[i])cout<<i<<endl;
	#endif
	while(cin>>a>>d>>n, a||d||n){
		int i, c = 0;
		for(i = a; i < 1000000; i += d){
			if(!prime[i]){
				c++;
				if(c == n)break;
			}
		}
		cout<<i<<endl;
	}
	return 0;
}

Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
main.c:4:1: error: unknown type name 'bool'
    4 | bool prime[1000000] = {0};
      | ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | //#define DEBUG
main.c: In function 'main':
main.c:11:44: error: 'true' undeclared (first use in this function)
   11 |                                 prime[j] = true;
      |                                            ^~~~
main.c:11:44: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:11:44: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:15: error: 'cin' undeclared (first use in this function)
   19 |         while(cin>>a>>d>>n, a||d||n){
      |               ^~~
main.c:27:17: error: 'cout' undeclared (first use in this function)
   27 |                 cout<<i<<endl;
      |                 ^~~~
main.c:27:26: error: 'endl' undeclared (first use in this function)
   27 |                 cout<<i<<endl;
      |                          ^~~~
Language: C

C[1000000];
main(){
	int i,j,a,d,n;
	C[1]=1;
	for(i=2;i<500000;i++)
		for(j=i*2;j<1000000;j+=i)
			C[j]=1;
	for(;scanf("%d%d%d",&a,&d,&n),n;){
		a-=d;
		for(;n--;){
			for(;C[a+=d];);
		}
		printf("%d\n",a);
	}
	exit(!puts(""));

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | C[1000000];
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'C' [-Wimplicit-int]
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |         for(;scanf("%d%d%d",&a,&d,&n),n;){
      |              ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | C[1000000];
main.c:8:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |         for(;scanf("%d%d%d",&a,&d,&n),n;){
      |              ^~~~~
main.c:8:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |                 printf("%d\n",a);
      |                 ^~~~~~
main.c:13:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   15 |         exit(!puts(""));
      |         ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | C[1000000];
main.c:15:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   15 |         exit(!puts(""));
      |         ^~~~
main.c:15:9: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:15:15: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   15 |         exit(!puts(""));
      |               ^~~~
main.c:15:15: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:15:9: error: expected declaration or statement at end of input
   15 |         exit(!puts(""));
      |         ^~~~
Language: C++

#include <iostream>
#include<string>
#include<cmath>
#include<stack>
#include<map>


int main()
{
    while(1){
    int a,d,n;
    cin>>a>>d>>n;
    if(a==0 and d==0 and n==0){break;}

    num=d*n;

    anseru=a+num;


    cout<<anseru;



    }


    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |     cin>>a>>d>>n;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:5: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |     num=d*n;
      |     ^~~
      |     enum
a.cc:17:5: error: 'anseru' was not declared in this scope
   17 |     anseru=a+num;
      |     ^~~~~~
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout<<anseru;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include<string>
#include<cmath>
#include<stack>
#include<map>
using namespace std;

#define NUM 1000001

int main()
{

//素数チェックに用いるーーーーーーーーー
int* table = new int[NUM];
int limit;

for(int i=0; i < NUM;i++)table[i] = 1;
table[0]=0;
table[1]=0;
limit = sqrt(NUM);


cout<<"limit"<<limit<<endl;
 for(int i=2;i<=limit;i++){
        if(table[i] == 1){
            for(int k=2*i;k < NUM; k += i){
                table[k] = 0;
            }
        }
    }


//ーーーーーーーーーーーーーーーーーーーーーーーーーーーー



    int a,d,n;
    int anser;

    while(1){
  

    cin>>a>>d>>n;
    anser=0;
    if(a==0 and d==0 and n==0){break;}
    for(int i=1; i<= 1000000; i++){
            if(table[a+(i-1)*d] == 1)count++;
            if(count == n){
                cout<<a+(i-1)*d<<endl;
                break;
            }
        }
 



    }


    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:47:38: error: 'count' was not declared in this scope
   47 |             if(table[a+(i-1)*d] == 1)count++;
      |                                      ^~~~~
a.cc:48:16: error: 'count' was not declared in this scope
   48 |             if(count == n){
      |                ^~~~~
Language: C++

#include <iostream>

using namespace std;

typedef long long ll;

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

int main() {
	int a, d, n;
	while ( cin >> a >> d >> n, a || d || n ) {
		int cnt = 0;
		int ans = 0;
		for (ll i = a;; i += d) {
			if (isPrime(i)) {
				if (++cnt == n) {
					ans = i;
					break;
				}
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'bool isPrime(int)':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         if (i <= 1) return false;
      |             ^
Language: C++


#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <stdlib.h>

using namespace std;

//与えられた数が素数かどうか判定する
int isPrime(unsigned long long int x) {
	if(x == 0) return 0;
	if(x == 1) return 0;

	int flg = 1;
	for(int i = 2; i < (int)sqrt((double)x) + 1; i++) {
		if(x % i == 0) {
			flg = 0;
			break;
		}
	}
	return flg;
}


int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	while(1) {
		unsigned long long int a, d, n;
		unsigned long long int ans, tmp;
		int cnt = 0;
		cin >> a >> d >> n;
		tmp = a;
		if( a == 0 && d == 0 && n == 0 ) break;	//終了処理

		//素数を求めるループ
		while(1) {
			if( isPrime(tmp) ) cnt ++;
			if( cnt ==  n ) {
				ans = tmp;
				break;
			}
			tmp += d;
		}

		//出力
		cout << ans << endl;
	}


	
	//while(1){}
	return 0;
}

Compiler output:
a.cc: In function 'int isPrime(long long unsigned int)':
a.cc:17:33: error: 'sqrt' was not declared in this scope
   17 |         for(int i = 2; i < (int)sqrt((double)x) + 1; i++) {
      |                                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define all(a) (a).begin(), (a).end()

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

/*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/
const int MAX = 1000100;
bool prime[MAX];

void sieve(){
    fill(prime, prime+MAX, true);
    prime[0] = prime[1] = false;

    for(int i=0; i < MAX; i++){
	        if(!prime[i]) continue;
	        for(int j=i+i; j < MAX; j += i){
			            prime[j] = false;
			        }
	    }
}


int main(){
	int a, d, n;
	sieve();
	while(cin >> a >> d >> n, a+d+n){
		int count = 0;
		while(true){
			if(prime[a]) n--;
			if(n == 0) break;
			a+=d;
		}
		cout << a << endl;
	}
}

Compiler output:
a.cc:14:1: error: unterminated comment
   14 | /*テァツエツ?ヲツ閉ーテ・ツ按、テ・ツョツ?/
      | ^
Language: C++

#include <stdio.h>

int a, d, n;
int m, x;
int temp;

int main(void)
{
    while(1) {
	scanf("%d %d %d", &a, &d, &n);
	if (a == 0) break;
	m = a;
	while(n > 0) {
	    temp = 0;
	    if (m > 1) {
		for (x = 2; x <= m / 2 + 1; x++) {
		    if (m % x == 0) {
			temp = 1;
			break;
		}
	    }
	    if (temp == 0) {
		n--;
	    }
	    m += d;
	}
	printf("%d\n", m - d);
    
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <stdio.h>

int a, d, n;
int m, x;
int temp;

int main(void)
{
    while(1) {
	scanf("%d %d %d", &a, &d, &n);
	if (a == 0) break;
	m = a;
	while(1) {
	    temp = 0;
	    if (m > 1) {
		for (x = 2; x <= m / 2 + 1; x++) {
		    if (m % x == 0) {
			temp = 1;
			break;
		}
	    }
	    if (temp == 0) {
		n--;
	    }
	    if (n = 0) break;
	    m += d;
	}
	printf("%d\n", m);
    
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,d,n,so[1000000]={},i,j;
  so[1]=1;
  for(i=2;i<1000;i++)if(so[i]==0)for(j=2;i*j<1000000;j++)so[i*j]=1;
  while(1){
    cin>>a>>d>>n;
    if(n==0)break;
    j=0;
    for(i=a;c<n;i+=d)if(so[i]==0)j++;
    cout<<i-d<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'c' was not declared in this scope
   11 |     for(i=a;c<n;i+=d)if(so[i]==0)j++;
      |             ^
Language: C++

#include <iostream>
bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){std::cin>>a>>d>>n;if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}std::cout<<a-d<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:249: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    2 | bool isprime(int n,int k=2){if(n==1){return false;}if(n<k*k){return true;}if(n%k==0){return false;}return isprime(n,k+1);}int main(){int a,d,n,c;while(true){std::cin>>a>>d>>n;if(n==0){break;}c=0;while(c<n){if(isprime(a)){c++;}a+=d;}std::cout<<a-d<<endl;}}
      |                                                                                                                                                                                                                                                         ^~~~
      |                                                                                                                                                                                                                                                         std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std; int a, b, c, i, n;
int main() {
	while (true) {
		n = 0;
		cin >> a >> b >> c;
		if (!a) {
			break;
		}
		while(n<c){
			for (i = 2; i <= sqrt(a); i++) {
				if (a%i == 0) {
					goto E;
				}
			}
			n++;
		E:;
			a += b;
		}
		cout << a - b << endl;
	}
}

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

#include<iostream>
using namespace std; int a, b, c, i, n;
int main() {
	while (true) {
		n = 0;
		cin >> a >> b >> c;
		if (!a) {
			break;
		}
		while(n<c){
			if (a < 2) {
				goto E;
			}
			for (i = 2; i <= sqrt(a); i++) {
				if (a%i == 0) {
					goto E;
				}
			}
			n++;
		E:;
			a += b;
		}
		cout << a - b << endl;
	}
}

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

367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 50 85
1 1 1
9075 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 367 186 151
      | ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
 
int Prime(int p){
  int i,f;
  f = 0;
  if(p == 1) return 0;
  if(p == 2) return 1;
  if(p % 2 == 0) return 0;
  for(i=3;i*i <= p;i += 2){
    if(p % i == 0) f = 1;
  }
 
  if(f == 0) return 1;
  else return 0;
}
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1) {
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: 'prime' was not declared in this scope; did you mean 'Prime'?
   28 |             if(prime(i)) {
      |                ^~~~~
      |                Prime
Language: C++

#include <bits/stdc++.h>

#define INF INT_MAX
#define ll long long

#define MAX_SIZE 1100000	//??????????????§???+10???

using namespace std;

bool is_prime[MAX_SIZE];	//true:?´???°???false:?´???°??\???

//n??\???????´???°?????°????±???????
int sieve(int n){
	for(int i = 0;i <= n;i++)is_prime[i] = true;
	is_prime[0] = is_prime[1] = false;	//0??¨1????´???°??§?????????
	for(int i = 2;i <= n;i++){
		if(is_prime[i]){
			//n??\??????n?????°?????????false?????????
			for(int j = 2*i; j <= n;j+=i){
				is_prime[j] = false;
			}
		}
	}
}

//?????????a,?????????d???????????°??????n????????????????´???°????????????
getNPrimeForProgression(int a,int d,int n){
	int c = 0,i = 1;
	while(c < n){
		if(is_prime[a+d*(i++-1)])c++;
	}
	i--;
	return a+d*(i-1);
}

int main(){
	int a,d,n;
	sieve(MAX_SIZE);	//MAX_SIZE?????§????´???°????±???????
	while(scanf("%d %d %d",&a,&d,&n) != EOF){
		if(a == 0 || d == 0 || n == 0)break;
		cout << getNPrimeForProgression(a,d,n) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int sieve(int)':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
a.cc: At global scope:
a.cc:27:1: error: ISO C++ forbids declaration of 'getNPrimeForProgression' with no type [-fpermissive]
   27 | getNPrimeForProgression(int a,int d,int n){
      | ^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<string.h>
#include<set>
#include<functional>
using namespace std;

#define INF 1<<21
#define MOD 1000000007
#define MAX 1000000

int main() {
  int p[MAX];
  memset(p, 1, sizeof(p));
  p[0] = 0;
  p[1] = 0;
  for (int i = 2; i <= sqrt(MAX)+1; i++) {
	if (p[i] == 1) {
	  for (int j = 2*i; j <= MAX; j += i) {
		p[j] = 0;
	  }
	}
  }

  int a, d, n;
  while (1) {
	cin >> a >> d >> n;
	if (a == 0 && d == 0 && n == 0)return 0;
	while (1) {
	  if (p[a] == 1) n--;
	  if (n == 0) {
		cout << a << endl;
		break;
	  }
	  a += d;
	}
  }
}

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

#include <iostream>
using namespace std;

bool prime_check(int n){
    switch(n){
        case 1: return false;
        case 2: return true;
    } 
    if(n%2 == 0) return false;
    for(int i=3;i*i<=n;i+=2){
        if(n%i == 0) return false;
    }
    return true;
}

int main(){
    int a,d,n;
    while(cin>>a>>d>>n, a&d&n){
       int count=0,ans=0,num;
       for(int i=0; count!=n ;i++){
        ??? num = a + (d*i);
           if(prime_check(num)==true){
               count++;
               ans = num;
           }
       }
       cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: expected primary-expression before '?' token
   21 |         ??? num = a + (d*i);
      |         ^
a.cc:21:10: error: expected primary-expression before '?' token
   21 |         ??? num = a + (d*i);
      |          ^
a.cc:21:11: error: expected primary-expression before '?' token
   21 |         ??? num = a + (d*i);
      |           ^
a.cc:21:28: error: expected ':' before ';' token
   21 |         ??? num = a + (d*i);
      |                            ^
      |                            :
a.cc:21:28: error: expected primary-expression before ';' token
a.cc:21:28: error: expected ':' before ';' token
   21 |         ??? num = a + (d*i);
      |                            ^
      |                            :
a.cc:21:28: error: expected primary-expression before ';' token
a.cc:21:28: error: expected ':' before ';' token
   21 |         ??? num = a + (d*i);
      |                            ^
      |                            :
a.cc:21:28: error: expected primary-expression before ';' token
Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

bool dprime[1000000] = { false };
void dPrime() {
	dprime[1] = true;
	for (int i = 2; i*i<1000000; i++) {
		if (!dprime[i]) {
			for (int j = 2 * i; j<1000000; j += i) {
				dprime[j] = true;
			}
		}
	}

	return;
}

int main() {
	dPrime();
	int n, a, d;
	while (cin >> a >> d >> n&&a&&d&&n) {
		int count = 0;
		for (int i = a;; i += d) {
			if (!dprime[i]) count++;
			if (count == n) {
				cout << i << endl;
				break;
			}
		}
	}
	return 0;

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

#include<iostream>
using namespace std;
int main(void)
{
    bool prime[100005];
    for(int i = 0 ; i < 100005 ; i++){prime[i] = true;}
    for(int k = 1 ; k < 105 ; k++){
        for(int j = 2 ; j * i < 100005 ; j++){
            prime[k*j]=false;
        }
    }
    for(;;){
        int a, d, n;
        cin >> a >> d >> n;
        if(a == 0 && d == 0 && n == 0){
            return 0;
        }
        int ans;
        for(int i = 1 ; i < 100005 ; i++){
            if(prime[a + d * i] == true){
                if(n == 0){
                    ans = a + d * i;
                }else{
                    n--;
                }
            }
        }
        cout << ans;
    }
}


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

#include <iostream>
using namespace std;
int main(void){
    for(;;){
        int a,d,n;
        cin >> a >> d >> n;
        for(a == 0 && d == 0 && n == 0){ return 0; }
        int ans = -1;
        for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
            bool prime = true;
            for(int j = 2 ; j <= 1000 ; j++){
                ((a + d * i) % j == 0){prime = false;}
            }
            if(prime){
                if(n == 1){ans = a + d * i;}else{n--;}
            }
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected ';' before ')' token
    7 |         for(a == 0 && d == 0 && n == 0){ return 0; }
      |                                       ^
      |                                       ;
a.cc:9:9: error: expected primary-expression before 'for'
    9 |         for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
      |         ^~~
a.cc:8:22: error: expected ')' before 'for'
    8 |         int ans = -1;
      |                      ^
      |                      )
    9 |         for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
      |         ~~~           
a.cc:7:12: note: to match this '('
    7 |         for(a == 0 && d == 0 && n == 0){ return 0; }
      |            ^
a.cc:12:39: error: expected ';' before '{' token
   12 |                 ((a + d * i) % j == 0){prime = false;}
      |                                       ^
      |                                       ;
a.cc:18:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <iostream>
using namespace std;
int main(void){
    for(;;){
        int a,d,n;
        cin >> a >> d >> n;
        for(a == 0 && d == 0 && n == 0){ return 0; }
        int ans = -1;
        for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
            bool prime = true;
            for(int j = 2 ; j <= 1000 ; j++){
                if((a + d * i) % j == 0){prime = false;}
            }
            if(prime){
                if(n == 1){ans = a + d * i;}else{n--;}
            }
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected ';' before ')' token
    7 |         for(a == 0 && d == 0 && n == 0){ return 0; }
      |                                       ^
      |                                       ;
a.cc:9:9: error: expected primary-expression before 'for'
    9 |         for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
      |         ^~~
a.cc:8:22: error: expected ')' before 'for'
    8 |         int ans = -1;
      |                      ^
      |                      )
    9 |         for(int i = 0 ; a + d * i <= 1000000 && (ans == -1) ; i++ ){
      |         ~~~           
a.cc:7:12: note: to match this '('
    7 |         for(a == 0 && d == 0 && n == 0){ return 0; }
      |            ^
a.cc:18:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

bool isprime(int n) {
    bool result = true;
    
    if(n==1) {
        return false;
    }
    else if(n < 2) {
        for(i=3; i<sqrt(n); i++) {
            if(n%i == 0) {
                return false;
            }
        }
        return result;
}

void solve(int s, int e, int d) {
    int i = 0;
    
    while(i<e) {
        while(!isprime(s)) {
            s+=d;
        }
        i++;
    }
    printf("%d\n", s);
}

int main(void) {
    int s=1; int e=1; int d=1;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        solve(s,e,d);
    }
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         for(i=3; i<sqrt(n); i++) {
      |             ^
a.cc:19:33: error: a function-definition is not allowed here before '{' token
   19 | void solve(int s, int e, int d) {
      |                                 ^
a.cc:31:16: error: a function-definition is not allowed here before '{' token
   31 | int main(void) {
      |                ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:4:21: note: to match this '{'
    4 | bool isprime(int n) {
      |                     ^
a.cc:41:2: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      |  ^
Language: C++

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

bool isprime(int n) {
    bool result = true;
    int i;
    
    if(n==1) {
        return false;
    }
    else if(n < 2) {
        for(i=3; i<sqrt(n); i++) {
            if(n%i == 0) {
                return false;
            }
        }
        return result;
}

void solve(int s, int e, int d) {
    int i = 0;
    
    while(i<e) {
        while(!isprime(s)) {
            s+=d;
        }
        i++;
    }
    printf("%d\n", s);
}

int main(void) {
    int s=1; int e=1; int d=1;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        solve(s,e,d);
    }
}


Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:20:33: error: a function-definition is not allowed here before '{' token
   20 | void solve(int s, int e, int d) {
      |                                 ^
a.cc:32:16: error: a function-definition is not allowed here before '{' token
   32 | int main(void) {
      |                ^
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:4:21: note: to match this '{'
    4 | bool isprime(int n) {
      |                     ^
a.cc:42:2: warning: control reaches end of non-void function [-Wreturn-type]
   42 | }
      |  ^
Language: C++

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

int main(void) {
    bool isprime(int n) {
    bool result = true;
    int i;
    
    if(n==1) {
        return false;
    }
    else if(n < 2) {
        for(i=3; i<sqrt(n); i++) {
            if(n%i == 0) {
                return false;
            }
        }
        return result;
}
    int s=1; int e=1; int d=1; int i;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        i = 0;
        while(i<e) {
            while(!isprime(s)) {
                s+=d;
            }
            i++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: a function-definition is not allowed here before '{' token
    5 |     bool isprime(int n) {
      |                         ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
    bool isprime(int n) {
    bool result = true;
    int i;
    
    if(n==1) {
        return false;
    }
    else if(n < 2) {
        for(i=3; i<sqrt(n); i++) {
            if(n%i == 0) {
                return false;
            }
        }
        return result;
}
    int s=1; int e=1; int d=1; int i;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        i = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            for(i=3; i<sqrt(s) || result=true; i++) {
                if(s%i == 0) {
                    result=false;
                }
            }
            if(result=true)
                i++;
                
                
        while(i<e) {
            s+=d;
            
            if(s < 2) {
                for(i=3; i<sqrt(s) || result == true; i++) {
                    if(s%i == 0) {
                        result = false;
                    }
                }
            }
            
            if(result = true)
                i++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: a function-definition is not allowed here before '{' token
    5 |     bool isprime(int n) {
      |                         ^
a.cc:58:2: error: expected '}' at end of input
   58 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
    int s=1; int e=1; int d=1; int i;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        i = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            for(i=3; i<sqrt(s) || result=true; i++) {
                if(s%i == 0) {
                    result=false;
                }
            }
            if(result=true)
                i++;
                
                
        while(i<e) {
            s+=d;
            
            if(s < 2) {
                for(i=3; i<sqrt(s) || result == true; i++) {
                    if(s%i == 0) {
                        result = false;
                    }
                }
            }
            
            if(result = true)
                i++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'result' was not declared in this scope
   15 |             result=false;
      |             ^~~~~~
a.cc:18:35: error: 'result' was not declared in this scope
   18 |             for(i=3; i<sqrt(s) || result=true; i++) {
      |                                   ^~~~~~
a.cc:23:16: error: 'result' was not declared in this scope
   23 |             if(result=true)
      |                ^~~~~~
a.cc:31:39: error: 'result' was not declared in this scope
   31 |                 for(i=3; i<sqrt(s) || result == true; i++) {
      |                                       ^~~~~~
a.cc:38:16: error: 'result' was not declared in this scope
   38 |             if(result = true)
      |                ^~~~~~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
    int s=1; int e=1; int d=1; int i; bool result;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        result=true;
        i = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            for(i=3; i<sqrt(s) || result=true; i++) {
                if(s%i == 0) {
                    result=false;
                }
            }
            if(result=true)
                i++;
                
                
        while(i<e) {
            result=true;
            s+=d;
            
            if(s < 2) {
                for(i=3; i<sqrt(s) || result == true; i++) {
                    if(s%i == 0) {
                        result = false;
                    }
                }
            }
            
            if(result = true)
                i++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: lvalue required as left operand of assignment
   19 |             for(i=3; i<sqrt(s) || result=true; i++) {
      |                      ~~~~~~~~~~^~~~~~~~~
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
    int s=1; int e=1; int d=1; int i; int m; bool result;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        result=true;
        m = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            for(i=3; (i<sqrt(s) || result=true);i++) {
                if(s%i == 0) {
                    result=false;
                }
            }
            if(result=true)
                m++;
                
                
        while(m<e) {
            result=true;
            s+=d;
            
            if(s < 2) {
                for(i=3; (i<sqrt(s) || result == true); i++) {
                    if(s%i == 0) {
                        result = false;
                    }
                }
            }
            
            if(result = true)
                m++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: lvalue required as left operand of assignment
   19 |             for(i=3; (i<sqrt(s) || result=true);i++) {
      |                       ~~~~~~~~~~^~~~~~~~~
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
    int s=1; int e=1; int d=1; int i; int m; bool result;
    
    while(s==0 && e==0 && d==0) {
        scanf("%s",s);
        scanf("%s",e);
        scanf("%s",d);
        
        result=true;
        m = 0;
        
        if(s==1) {
            result=false;
        }
        else if(s < 2) {
            i=3;
            while(i<sqrt(s) || result=true) {
                if(s%i == 0) {
                    result=false;
                }
                i++;
            }
            if(result=true)
                m++;
                
                
        while(m<e) {
            result=true;
            s+=d;
            
            if(s < 2) {
                i=3;
                while(i<sqrt(s) || result == true) {
                    if(s%i == 0) {
                        result = false;
                    }
                    i++;
                }
            }
            
            if(result = true)
                m++;
        }
        printf("%d\n", s);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: lvalue required as left operand of assignment
   20 |             while(i<sqrt(s) || result=true) {
      |                   ~~~~~~~~~~^~~~~~~~~
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	bool isPrime[1000000]; 
	memset(isPrime, true, sizeof(isPrime));
	isPrime[1] = false;
	for(int i=2;i<1000000;i++){
		for(int j=2;i*j<1000000;j++) isPrime[i*j] = false;
	}
	int a, d, n;
	while(cin >> a >> d >> n){
		if(!a) break;
		int count = 1;
		for(int i=a;;i+=d){
			if(isPrime[i]){
				if(count == n) { cout << i << endl; break; }
				else count++;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
    7 |         memset(isPrime, true, sizeof(isPrime));
      |         ^~~~~~
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 |
Language: C++

#include <iostream>

using namespace std;

// éªf©»Ê·éÖEßèl0:fÅÈ¢ 1:f
int checkNumber(int num){

	if( num<=1 ) return 0;//1ÍfÅÈ¢
    
    for(int i=2; i<((num+1)/2) ; i++ ){
        if (num%i == 0 ) {
			return 0;//èØê½çfÅÈ¢
	    }        
    }

	return 1;//è«êÈ©Á½ÌÅf
}


int main(){

	int a,d,n,number,answer;
	int count;

	while(1)
		cin >> a >> d >> n;
		number = a;
		count = 1;
		if(a==0 && d==0 && n==0)break;//0 0 0ÌüÍÅI¹
		
		while(1){//¦ªoéÜÅ³À[v
			if( checkNumber(number)==1 ){
				if(n==count){//¦¾Á½çbreak
					answer = number;
					break;
				}
				else{
					count++;
				}
			}
			number += d;//lðd¸Ââ·
		}

		//¦ÌoÍ
		cout << answer << "\n";
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:41: error: break statement not within loop or switch
   29 |                 if(a==0 && d==0 && n==0)break;//0 0 0ÌüÍÅI¹
      |                                         ^~~~~
a.cc: At global scope:
a.cc:48:9: error: expected unqualified-id before 'return'
   48 |         return 0;
      |         ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

// éªf©»Ê·éÖEßèl0:fÅÈ¢ 1:f
int checkNumber(int num){

	if( num<=1 ) return 0;//1ÍfÅÈ¢
    
    for(int i=2; i<((num+1)/2) ; i++ ){
        if (num%i == 0 ) {
			return 0;//èØê½çfÅÈ¢
	    }        
    }

	return 1;//è«êÈ©Á½ÌÅf
}


int main(){

	int a,d,n,number,answer;
	int count;

	while(1)
		cin >> a >> d >> n;
		number = a;
		count = 1;
		if(a==0 && d==0 && n==0)break;//0 0 0ÌüÍÅI¹
		
		while(1){//¦ªoéÜÅ³À[v
			if( checkNumber(number)==1 ){
				if(n==count){//¦¾Á½çbreak
					answer = number;
					break;
				}
				else{
					count++;
				}
			}
			number += d;//lðd¸Ââ·
		}

		//¦ÌoÍ
		cout << answer << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:41: error: break statement not within loop or switch
   29 |                 if(a==0 && d==0 && n==0)break;//0 0 0ÌüÍÅI¹
      |                                         ^~~~~
a.cc: At global scope:
a.cc:48:9: error: expected unqualified-id before 'return'
   48 |         return 0;
      |         ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^