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

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

int main(){
	int n,i,j,p[10000],sum=0;
	while(1){
                scanf("%d",&n)!=0
                if(n==0)break;
		for(i=2;;i++){
			for(j=2;j<=sqrt(i);j++){
			if(i%j==0)break;
			if(j==(int)sqrt(i)){p[n]=i;n--;break;}
			}
			if(n==0)break;
		}

		for(i=n;i>0;i--){sum += p[i];}
		printf("%d",sum);

	}

}

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

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

int main(){
	int n,i,j,p[10000],sum=0;
	while(1){
                scanf("%d",&n)
                if(n==0)break;
		for(i=2;;i++){
			for(j=2;j<=sqrt(i);j++){
			if(i%j==0)break;
			if(j==(int)sqrt(i)){p[n]=i;n--;break;}
			}
			if(n==0)break;
		}

		for(i=n;i>0;i--){sum += p[i];}
		printf("%d",sum);

	}

}

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

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

int main(){
	int n,i,j,p[10000],sum=0;
	while(1){
                scanf("%d",&n)
                if(n==0)break;
		for(i=2;;i++){
			for(j=2;j<=sqrt(i);j++){
			if(i%j==0)break;
			if(j==(int)sqrt(i)){p[n]=i;n--;break;}
			}
			if(n==0)break;
		}

		for(i=n;i>0;i--){sum += p[i];}
		printf("%d",sum);

	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ';' before 'if'
    8 |                 scanf("%d",&n)
      |                               ^
      |                               ;
    9 |                 if(n==0)break;
      |                 ~~
Language: C++

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

int prime(int n) {
	int i, j, d;
	if (n == 1)return 2;
	d = prime(n - 1);
	for (i = d+1;; i++) {
		for (j = 2;; j++) {
			if (i%j == 0)break;
			if (j == i - 1) { return i; }
		}
	}
}

int main() {
	int n,i, sum = 0;
	while (scanf_s("%d", &n) && n){
		if (n == 0)break;
		for (i = 1; i <= n; i++)sum += prime(i);
		printf("%d\n", sum);
		sum = 0;
	}
	return 0;
}

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

#include<cstdio>
#include<cmath>
using namespace std;
int dp[10010];

int prime(int n) {
	int i, j,d;
	if (n == 1) { return dp[1] = 2; };
	d = dp[n - 1];
	for (i = d+1;; i++) {
		for (j = 2;; j++) {
			if (i%j == 0)break;
			if (j == (int)sqrt(i)) { return dp[n] = i; }
		}
	}
}

int main() {
	int n, i;
	long long sum = 0;
	while (scanf_s("%d", &n) && n){
		if (n == 0)break;
		for (i = 1; i <= n; i++)sum += prime(i);
		printf("%d\n", sum);
		sum = 0;
	}
	return 0;
}

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

#include<iostream>
using namespace std;

int n;
int tf[400];
int prime[400];

void P(int n){
	int t = sqrt(n), k = 0;
	for (int i = 2; i <= t; i++){
		if (tf[i] == 0){
			for (int j = 2; j*i <= t; j++){
				tf[j*i] = 1;
			}
		}
	}

	for (int i = 2; i <= t; i++){
		if (!tf[i])prime[k++] = i;
	}
}

int main(){
	P(15000);
	int n;
	long long sum;
	cin >> n;
	for (int i = 0; i < n; i++){
		sum += prime[i];
	}
}

Compiler output:
a.cc: In function 'void P(int)':
a.cc:9:17: error: 'sqrt' was not declared in this scope
    9 |         int t = sqrt(n), k = 0;
      |                 ^~~~
a.cc:19:34: error: 'k' was not declared in this scope
   19 |                 if (!tf[i])prime[k++] = i;
      |                                  ^
Language: C++

#include<iostream>
using namespace std;
bool flag[10010];
int p[10000];

int main(){
	int n=1;
	while (cin >> n, n != 0){
		era(n);
		int sum = 0;
		for (int i = 0; i < n; i++){
			sum += p[i];
		}
		cout << sum << endl;
	}
	
}

void era(int n){
	int l = 0;
	for (int i = 2; i < 12*n && flag[i]==false; i++){
		p[l++] = i;
		for (int j = i; j < 12 * n; j += i){
			flag[j] = true;
		}
	}
}

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

int main(void)
{
	int n,l,j,i;
	long s;
	for(;;){
		j=0;
		s = 0;
		scanf("%d",&n);
		if(n==0)break;
		for(i = 2; i<=10000;i++){
			l = 2;
			if(i == 2 || i == 3 ){
				j = j+1;
				s+= i;
				if(j >= n) break;
			}else if(i % 2 == 0){
			}else if(i > 2){
				while(l <=i/2){
					if(i % l ==0  ){
						l = i;
					}
					l = l+1;

				}
				if(l <=2+i/2){
					j = j+1;
					s+= i ;
					if(j >= n) break;
				}
			}

		}
		printf("%ld\n",s);
		
	}
	return 0;

}

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

int main(int argc, char* argv[])
{
	int n,l,j,i;
	long s;
	for(;;){
		j=0;
		s = 0;
		scanf("%d",&n);
		if(n==0)break;
		for(i = 2; i<=10000;i++){
			l = 2;
			if(i == 2 || i == 3 ){
				j = j+1;
				s+= i;
				if(j >= n) break;
			}else if(i % 2 == 0){
			}else if(i > 2){
				while(l <=i/2){
					if(i % l ==0  ){
						l = i;
					}
					l = l+1;

				}
				if(l <=2+i/2){
					j = j+1;
					s+= i ;
					if(j >= n) break;
				}
			}

		}
		printf("%ld\n",s);
		
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:17: error: 'scanf' was not declared in this scope
    8 |                 scanf("%d",&n);
      |                 ^~~~~
a.cc:33:17: error: 'printf' was not declared in this scope
   33 |                 printf("%ld\n",s);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(int argc, char* argv[])
Language: C++

require "prime"

table = Prime.each.take(10000);

loop do
	n = gets.to_i
	break if n==0
	subtable = table.take(n)
	p subtable.inject(:+)
end

Compiler output:
a.cc:1:1: error: 'require' does not name a type
    1 | require "prime"
      | ^~~~~~~
a.cc:5:1: error: 'loop' does not name a type
    5 | loop do
      | ^~~~
Language: C++

require 'prime'

table = Prime.each.take(10000)

loop do
	n = gets.to_i
	break if n==0
	subtable = table.take(n)
	p subtable.inject(:+)
end

Compiler output:
a.cc:1:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    1 | require 'prime'
      |         ^~~~~~~
a.cc:1:1: error: 'require' does not name a type
    1 | require 'prime'
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int a[20000] = {};

int sosuu() {
	a[0] = 0;
	int k = 1, z;
	for (int i = 2; i<100000 || k<10001; i++) {
		z = 0;
		for (int j = 2; j <= sqrt(i); j++) {
			if (i%j == 0) {
				z++;
				break;
			}
		}
		if(z==0){
			a[k] = i;
			k++;
		}
	}
	return 0;
}

int main(){
	sosuu();
	int in;
	long int ans;
	while (cin >> in){
		if (in == 0) { break; }
		ans = 0;
		for(int i = 1; i<=in;i++){
			ans += a[i];
		}
		cout << ans << endl;
	}
	return 0;
}

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
 
class Program
{
    static void Main(string[] args)
    {
   while(true){
int n=int.Parse(n1),sum=0;
if(n==0){break;}for(int i=1;;i++)
{
if(n==0){break;}//n--;
if(IsPrime(i))
{
n--;sum+=i;
}
 
}Console.WriteLine(sum);
}
    }
    public static Boolean uso() { return false; }
    public static bool IsPrime(long n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
 
        for (int i = 2; i < n; i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
 
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static int Int()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] Ints()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:9:22: error: 'string' has not been declared
    9 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:9:31: error: expected ',' or '...' before 'args'
    9 |     static void Main(string[] args)
      |                               ^~~~
a.cc:24:11: error: expected ':' before 'static'
   24 |     public static Boolean uso() { return false; }
      |           ^~~~~~~
      |           :
a.cc:24:19: error: 'Boolean' does not name a type
   24 |     public static Boolean uso() { return false; }
      |                   ^~~~~~~
a.cc:25:11: error: expected ':' before 'static'
   25 |     public static bool IsPrime(long n)
      |           ^~~~~~~
      |           :
a.cc:37:2: error: expected ';' after class definition
   37 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:12:7: error: expected primary-expression before 'int'
   12 | int n=int.Parse(n1),sum=0;
      |       ^~~
a.cc:18:5: error: 'sum' was not declared in this scope
   18 | n--;sum+=i;
      |     ^~~
a.cc:21:2: error: 'Console' was not declared in this scope
   21 | }Console.WriteLine(sum);
      |  ^~~~~~~
a.cc:21:20: error: 'sum' was not declared in this scope
   21 | }Console.WriteLine(sum);
      |                    ^~~
a.cc: At global scope:
a.cc:38:1: error: expected unqualified-id before 'public'
   38 | public static class Read
      | ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	while(cin >> n,n){
		int v[1000000];
		for(int i=0;i<1000000;i++) v[i]=1;
		v[0]=v[1]=0;
		for(int i=0;i*i<=100000;i++){
			if(v[i]){
				for(int j=i*2;j<100000;j+=i){
					v[j]=0;
				}
			}
		}
		int s=0,i=0;
		while(n--){
			while(!v[i])i++;
			s+=i++;
		}
		cout << s << endl;javascript:void(0)
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:53: error: expected ';' before '}' token
   21 |                 cout << s << endl;javascript:void(0)
      |                                                     ^
      |                                                     ;
   22 |         }
      |         ~
Language: C++

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

const max=104729;
char so[104730];

int main(){
	int i,j,n,s;
	
	memset(so,0,sizeof(so));
	
	so[0]=so[1]=1;
	
	for(i=2;i*i<=max;i++){
		for(j=2*i;j<=max;j+=i){
			so[j]=1;
		}
	}
	while(0<=scanf("%d",&n)){
		if(n==0)break;
		s=0;
		for(i=1;n;i++){
			if(so[i]==0){
				s+=i;
				--n;
			}
		}
		printf("%d\n",s);
	}
	return 0;
}

Compiler output:
a.cc:6:7: error: 'max' does not name a type
    6 | const max=104729;
      |       ^~~
a.cc: In function 'int main()':
a.cc:16:22: error: 'max' was not declared in this scope; did you mean 'std::max'?
   16 |         for(i=2;i*i<=max;i++){
      |                      ^~~
      |                      std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

#define MAX 1000000

int main()
{
  bitset<MAX> is_prime;
  is_prime.set();
  is_prime[0] = false, is_prime[1] = false;
  for (int i = 2; i * i <= MAX; i++) {
    for (int j = i + i; j <= MAX; j += i) {
      is_prime[j] = false;
    }
  }
  vector<int> prime;
  for (int i = 0; i < MAX; i++) {
    if (prime[i]) {
      prime.push_back(i);
    }
  }
  if (prime.size() < 10000) {
    printf("error\n");
    return 0;
  }

  int N;
  while (scanf("%d ", &N) == 1) {
    if (N == 0) {
      break;
    }
    int sum = 0;
    for (int i = 0; i < N; i++) {
      sum += prime[i];
    }
    printf("%d\n", sum);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'bitset' was not declared in this scope
   11 |   bitset<MAX> is_prime;
      |   ^~~~~~
a.cc:4:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    3 | #include <vector>
  +++ |+#include <bitset>
    4 | 
a.cc:11:15: error: 'is_prime' was not declared in this scope
   11 |   bitset<MAX> is_prime;
      |               ^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int MAX=INT_MAX;
	int prime[10000];
	bool num[110000]; for(int i=0;i<110000;i++) num[i]=false;
	num[0]=num[1]=true;
	for(int i=2;i<MAX;i++)
	{
		if(num[i]==true) continue;
		for(int j=i*2;j<110000;j+=i) num[j]=true;
	}
	int pnt=0;
	for(int i=0;i<110000;i++)
	{
		if(num[i]==false) prime[pnt++]=i;
		if(pnt>=10000) break;
	}
	//以上が素数の列挙
	int n;
	while(1)
	{
		cin >> n ; if(n==0) break;
		int sum=0;
		for(int i=0;i<n;i++) sum+=prime[i];
		cout << sum << '\n' ;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'INT_MAX' was not declared in this scope
    5 |         int MAX=INT_MAX;
      |                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <stdio.h>
#include <limits.h>
#include <time.h>
#define NN 10001

int main(int argc,char *argv[]){
	/*----宣言----*/
	unsigned long long int n;	//判定する素数
	int i,j,mode;				//カウンタ,モード
	clock_t start,end;			//経過時間測定用
	int number=0;				//1〜1000までの素数の個数
	bool flag=true;				//フラグ(素数のときtrue、素数でないときfalse)
	bool prime[NN];				//素数か否か判定 
	printf(" ______________________________________\n");
	printf("| 数字の上限は%lldです。|\n",LLONG_MAX);
	printf("| 小数点以下は切り捨てられます。       |\n");
	printf(" --------------------------------------\n");
	
	printf("1:試し割り\n2:エラトステネスの篩\n");
	printf("mode:");
	scanf("%d",&mode);
	printf("素数判定を行う数字(自然数)を入力してください：");
	scanf("%lld",&n);
	//初期化
	for(i=0;i<NN;i++) prime[i] = true;
//計測開始
	start = clock();
	if(n<=1) flag=false;
	else{
	//試し割り
		if(mode==1){
			for(i=2;i<n;i++){
				if(n%i==0) flag=false;
			}
		}
	//エラトステネスの篩
		else{
			for(i=2;i<n+1;i++){
				if(!flag) break;
				for(j=i*2;j<n+1;j=j+i) {
					if(j==n){
						flag=false;
						break;
					}
				}
			}
		}
	}
//計測終了
	end = clock();
	/*----出力----*/
	printf("%dは素数",n);
	if(flag)  printf("です。\n");
	else printf("ではありません。\n");
	printf("%lf[ms]かかりました。\n",(double)(end-start));
	
	/*----素数を数える----*/
	for(i=2;i<NN;i++){
			for(j=i*2;j<NN;j=j+i) prime[j]=false;
	}
	for(i=2;i<NN;i++){
		if(prime[i]==true){
			number++;
			printf("%d ",prime[i]);		
	}
	printf("1〜1000までの素数の個数は%d個です。\n",number);
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:68:2: error: expected '}' at end of input
   68 | }
      |  ^
a.cc:6:32: note: to match this '{'
    6 | int main(int argc,char *argv[]){
      |                                ^
Language: C++

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

#define NUM 131072
#define LOOTNUM 363

int _tmain(int argc, _TCHAR* argv[])
{
	bool prime[NUM];
	unsigned num;

	prime[1] = false;
	prime[2] = true;
	for(long i = 3; i < NUM; i += 2) {
		prime[i] = true;
	}

	for(long i = 3; i <= LOOTNUM; i += 2) {
		if(prime[i] == true)
			for(long j = 2 * i; j < NUM; j += i)
				prime[j] = false;
	}

	while(1) {
		cin >> num;

		if(num == 0) break;
		else if(num == 1) {cout << 2 << endl;}
			else {
			unsigned long sum = 2;
			long I = 3;
			num--;
	
			while(num) {
				if(prime[I] == true) {
					sum += I;
					num--;
				}
				I += 2;
			}
			cout << sum << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:8:22: error: '_TCHAR' has not been declared
    8 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

#define NUM 131072
#define LOOTNUM 363

int main(int argc, _TCHAR* argv[])
{
	bool prime[NUM];
	unsigned num;

	prime[1] = false;
	prime[2] = true;
	for(long i = 3; i < NUM; i += 2) {
		prime[i] = true;
	}

	for(long i = 3; i <= LOOTNUM; i += 2) {
		if(prime[i] == true)
			for(long j = 2 * i; j < NUM; j += i)
				prime[j] = false;
	}

	while(1) {
		cin >> num;

		if(num == 0) break;
		else if(num == 1) {cout << 2 << endl;}
			else {
			unsigned long sum = 2;
			long I = 3;
			num--;
	
			while(num) {
				if(prime[I] == true) {
					sum += I;
					num--;
				}
				I += 2;
			}
			cout << sum << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:4:20: error: '_TCHAR' has not been declared
    4 | int main(int argc, _TCHAR* argv[])
      |                    ^~~~~~
a.cc:4:5: warning: second argument of 'int main(int, int**)' should be 'char **' [-Wmain]
    4 | int main(int argc, _TCHAR* argv[])
      |     ^~~~
a.cc: In function 'int main(int, int**)':
a.cc:22:17: error: 'cin' was not declared in this scope
   22 |                 cin >> num;
      |                 ^~~
a.cc:25:36: error: 'cout' was not declared in this scope
   25 |                 else if(num == 1) {cout << 2 << endl;}
      |                                    ^~~~
a.cc:25:49: error: 'endl' was not declared in this scope
   25 |                 else if(num == 1) {cout << 2 << endl;}
      |                                                 ^~~~
a.cc:38:25: error: 'cout' was not declared in this scope
   38 |                         cout << sum << endl;
      |                         ^~~~
a.cc:38:40: error: 'endl' was not declared in this scope
   38 |                         cout << sum << endl;
      |                                        ^~~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int pnum[10000] = {0};
int dsum[10000] = {0};
int main(){
int N;
while(1){
cin >> N;
if(N == 0){
break;
}
return 0;
}

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

#include<iostream>
#include<math.h>
using namespace std;
int pnum[10000] = {0};
int psum[10000] = {0};
int main(){
int i,j,pcor = 0;
int root;
for(i = 2;i < 10001;i++){
root = (int)sqrt(double(i))+1;
for(j = 0;j < pcor && pnum[j] <= root;j++){
if(i% pnum[j]==0)break;
}
if(j == pcor || pnum[j] > root){
pnum[pcor] = i;
pcor++;
}
}
for(i = 0;i < pcor;i++){
if(i == 0)
psum[i] = pnum[i];
else
psum[i] = pnum[i]+psum[i-1];
}
int N,data[50000];
int dcor = 0;
while(1){
cin >> N;
if(N == 0)
break;
}
data[dcor] = psum[N-1];
dcor++;
}
for(i = 0;i <= dcor;i++){
printf("%d\n",data[i]);
}
return 0;
}

Compiler output:
a.cc:35:1: error: expected unqualified-id before 'for'
   35 | for(i = 0;i <= dcor;i++){
      | ^~~
a.cc:35:11: error: 'i' does not name a type
   35 | for(i = 0;i <= dcor;i++){
      |           ^
a.cc:35:21: error: 'i' does not name a type
   35 | for(i = 0;i <= dcor;i++){
      |                     ^
a.cc:38:1: error: expected unqualified-id before 'return'
   38 | return 0;
      | ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int pnum[10000] = {0};
int psum[10000] = {0};
int main(){
int i,j,pcor = 0;
int root;
for(i = 2;i < 10001;i++){
root = (int)sqrt(double(i))+1;
for(j = 0;j < pcor && pnum[j] <= root;j++){
if(i% pnum[j]==0)break;
}
if(j == pcor || pnum[j] > root){
pnum[pcor] = i;
pcor++;
}
}
for(i = 0;i <= pcor;i++){
if(i == 0)
psum[i] = pnum[i];
else
psum[i] = pnum[i]+psum[i-1];
}
int N,data[50000];
int dcor = 0;
while(1){
cin >> N;
if(N == 0)
break;
}
data[dcor] = psum[N-1];
dcor++;
}
for(i = 0;i <= dcor;i++){
printf("%d\n",data[i]);
}
return 0;
}

Compiler output:
a.cc:35:1: error: expected unqualified-id before 'for'
   35 | for(i = 0;i <= dcor;i++){
      | ^~~
a.cc:35:11: error: 'i' does not name a type
   35 | for(i = 0;i <= dcor;i++){
      |           ^
a.cc:35:21: error: 'i' does not name a type
   35 | for(i = 0;i <= dcor;i++){
      |                     ^
a.cc:38:1: error: expected unqualified-id before 'return'
   38 | return 0;
      | ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
typedef std::vector <int> vi;
vi PRIMES;
vi prime(int n){
	int i=0,j=1,h=(n+1)/2,x,r=(int)pow(n,.5);
	vi s(h),p;
	while(j<=n){
		s[i++]=j;
		j+=2;
	}
	p.push_back(2);
	for (i=1;i<h;i++)
		if (x=s[i]){
			p.push_back(x);
			if (i<=r) for (j=x*x/2;j<h;j+=x) s[j]=0;
		}
	return p;
}
int main(void){
	int n,s;
	PRIMES=prime(105000);
	while (true){
		std::cin>>n; if (n==0) break;
		for (s=0;n--;) s+=PRIMES[n];
		std::cout<<s<<"\n";
	}
} 

Compiler output:
a.cc: In function 'vi prime(int)':
a.cc:6:40: error: 'pow' was not declared in this scope
    6 |         int i=0,j=1,h=(n+1)/2,x,r=(int)pow(n,.5);
      |                                        ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
void mdm( int prime[] );

int main(){
  int j=0 ,n ,ans=0 ,flag=0;
  while( true ){
    cin >> n;
    if( n == 0 ) break;
    int prime[10000]; // 素数
    int allay[10000];
    memset( allay ,0 ,sizeof( allay ) );
    if( !flag ) mdm( prime ); // 素数仕分け
    flag = 1;
    for( int i=2 ;i<=10000 ; i++ ){
      if( prime[i] == 1 ){
	allay[j] = i;
	j++;
      }
    }

    for( int i=0 ; i<n ; i++ ){ // 加算
      ans += allay[i];
    }

    cout << ans << endl;
    ans = 0;
    j=0;
  }
}



void mdm( int prime[] ){ // ユークリッドの互除法
  int i ,j ,n=10000; 
  for( i=2 ; i<=n ; i++ ){ // 自然数を列挙
    prime[i] = 1;
  }
  i = 2;
  while( i*i <= n ){
    if( prime[i] == 1 ){ // 素数なら
      j = i*2;
      while( j <= n ){
	prime[j] = 0;
	j += i;
      }
    }
    i++;
  }
  return;
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a,b,n,ans = 0;
			a %= b;
		        for(int i = 0; i < n; i++){
			      a *= 10;
			      ans += a/b;
			      a %= b;
		        }
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:9: error: variable a might not have been initialized
			a %= b;
			^
Main.java:9: error: variable b might not have been initialized
			a %= b;
			     ^
Main.java:10: error: variable n might not have been initialized
		        for(int i = 0; i < n; i++){
		                           ^
3 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a,b,n;
                        int ans = 0;
			a %= b;
		        for(int i = 0; i < n; i++){
			      a *= 10;
			      ans += a/b;
			      a %= b;
		        }
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:10: error: variable a might not have been initialized
			a %= b;
			^
Main.java:10: error: variable b might not have been initialized
			a %= b;
			     ^
Main.java:11: error: variable n might not have been initialized
		        for(int i = 0; i < n; i++){
		                           ^
3 errors
Language: Java

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readlLine())!=null){
String[] values=line.split(" ");
int a=Integer.parseInt(values[0]);
int b=Integer.parseInt(values[1]);
int n=Integer.parseInt(values[2]);
double d=a/b;
int sum=0;
for(int i=1;i<=n;i++){
d*=10;
sum+=(int)d;
}
}
}
}

Compiler output:
Main.java:7: error: cannot find symbol
while((line=br.readlLine())!=null){
              ^
  symbol:   method readlLine()
  location: variable br of type BufferedReader
1 error
Language: Java

import java.io.*;
import java.math.BigDecimal;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
BigDecimal a=BigDecimal.valueOf(Integer.parseInt(values[0]));
BigDecimal b=BigDecimal.valueOf(Integer.parseInt(values[1]));
int n=Integer.parseInt(values[2]);
while(true){
if(a.intValue()>=b.intValue()){
a.substract(b);
continue;
}
break;
}
BigDecimal c=a.devide(b);
int sum=0;
c=c.multiply(BigDecimal.valueOf(Math.pow(10,n)));
c=c.setScale(0,BigDecimal.ROUND_DOWN);
int d=c.intValue();
String str=String.valueOf(d);
for(int i=0;i<n;i++){
if(str.charAt(i)==null){
continue;
}
sum+=(int)(str.charAt(i)-'0');
}
System.out.println(sum);
}
}
}

Compiler output:
Main.java:15: error: cannot find symbol
a.substract(b);
 ^
  symbol:   method substract(BigDecimal)
  location: variable a of type BigDecimal
Main.java:20: error: cannot find symbol
BigDecimal c=a.devide(b);
              ^
  symbol:   method devide(BigDecimal)
  location: variable a of type BigDecimal
Main.java:27: error: bad operand types for binary operator '=='
if(str.charAt(i)==null){
                ^
  first type:  char
  second type: <null>
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
Language: Java

import java.io.*;
import java.math.BigDecimal;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
BigDecimal a=BigDecimal.valueOf(Integer.parseInt(values[0]));
BigDecimal b=BigDecimal.valueOf(Integer.parseInt(values[1]));
int n=Integer.parseInt(values[2]);
while(true){
if(a.intValue()>=b.intValue()){
a=a.substract(b);
continue;
}
break;
}
BigDecimal c=a.divide(b);
int sum=0;
c=c.multiply(BigDecimal.valueOf(Math.pow(10,n)));
c=c.setScale(0,BigDecimal.ROUND_DOWN);
int d=c.intValue();
String str=String.valueOf(d);
for(int i=0;i<n;i++){
if(str.charAt(i)==null){
continue;
}
sum+=(int)(str.charAt(i)-'0');
}
System.out.println(sum);
}
}
}

Compiler output:
Main.java:15: error: cannot find symbol
a=a.substract(b);
   ^
  symbol:   method substract(BigDecimal)
  location: variable a of type BigDecimal
Main.java:27: error: bad operand types for binary operator '=='
if(str.charAt(i)==null){
                ^
  first type:  char
  second type: <null>
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
Language: Java

import java.io.*;
import java.math.BigDecimal;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null){
String[] values=line.split(" ");
BigDecimal a=BigDecimal.valueOf(Integer.parseInt(values[0]));
BigDecimal b=BigDecimal.valueOf(Integer.parseInt(values[1]));
int n=Integer.parseInt(values[2]);
while(true){
if(a.intValue()>=b.intValue()){
a=a.subtract(b);
continue;
}
break;
}
BigDecimal c=a.divide(b);
int sum=0;
c=c.multiply(BigDecimal.valueOf(Math.pow(10,n)));
c=c.setScale(0,BigDecimal.ROUND_DOWN);
int d=c.intValue();
String str=String.valueOf(d);
if(str.length()==n{
for(int i=0;i<str.length();i++){
sum+=(int)(str.charAt(i)-'0');
}
}
System.out.println(sum);
}
}
}

Compiler output:
Main.java:26: error: ')' expected
if(str.length()==n{
                  ^
1 error
Language: Java

import java.util.Scanner;

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

	public static void main(String[] args) {
		
		while ( sc.hasNext() ){
		
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		double n = sc.nextDouble();
		
		String ans = "" ;
		int s = 0 ;
		
		for ( int i = 1 ; i <= n ; i++){
			
			double x = a / b ;
			
			for ( int j = 1 ; j <= i ; j++){
				x = x * 10;
			}
			
		ans = String.valueOf( x % 10 );
		
		String[] array = ans.split("\\.");
		
		String ans2 = array[0];
		
		String[] array2 = ans2.split("");
		
		int l = array2.length;
		
		int z = Integer.parseInt(array2[l-1]);
		
			s = s + z ;	
		}
		
		System.out.println(s);
	}
	}

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

import java.util.*;

class Main {
  void run() {
    Scanner sc = new Scanner(System.in);
    while(sc.hasNext()) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      int n = sc.nextInt();
      int tmp;
      int s = 0;
      if (a>b) a = a%b;
      for (int i=0;i<n;i++) {
        a *= 10;
        s += a/b;
        a = a%b;
      }
      System.out.println(s);
    }
  }
  public static void main(String[] args) {
    New Main().run();
  }
}
        

Compiler output:
Main.java:22: error: ';' expected
    New Main().run();
            ^
1 error
Language: Java


import java.util.Scanner;

public class _0054 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		while(scan.hasNext()){
			int a = scan.nextInt();
			int b = scan.nextInt();
			int n = scan.nextInt();
			a%=b;
			int s = 0;
			for (int i = 0; i < n; i++) {
				s+=a*10/b;
				a=a*10%b;
			}
			System.out.println(s);
		}
	}
}

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


public class Main {

    public static void main(String[] args) {
    	
    	//declare    	
    	int      a,b,n,mod,s;
    	String[] str;
    	
    	//input
    	Scanner sc = new Scanner(System.in);
    	while(sc.hasNext()){
    		str = sc.nextLine().split("\\s");
    		a   = Integer.parseInt(str[0]);
    		b   = Integer.parseInt(str[1]);
    		n   = Integer.parseInt(str[2]);
    		
    		//calculate
    		s = 0;
    		a %= b;
    		while(n-- > 0){
    			a *= 10;
    			s += a / b;
    			a %= b;
    		}
    		//output
    		System.out.println(s);
    	}
    }
}

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

import java.util.Scanner;


public class Test {
	public static void main(String[] args){
		Scanner scan = null;
		try{
			double a , b;
			int n;
			scan = new Scanner(System.in);
			while(scan.hasNextInt()){
				a = scan.nextInt();
				b = scan.nextInt();
				n = scan.nextInt();
				double m =(a / b);
				m -= (int)m;
				int sum = 0;
				for(int i = 0 ; i < n;i++){
					m*=10;
					sum += (int)m;
					m -=(int)m;
				}
				System.out.println(sum);
			}
		}finally{
			if(scan !=null)scan.close();
		}
	}
}

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

#include <stdio.h>

int main(){
    int a, b, n, s;
    double f;
    
    while(scanf("%d %d %d", &a, &b, &n) != EOF){
        f = (double)a / b;
        s = 0;
            
        while(i--){
            s += (int)(f * 10) % 10;
            f *= 10;
        }
        
        printf("%d\n", s);
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:15: error: 'i' undeclared (first use in this function)
   11 |         while(i--){
      |               ^
main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
int main(void){
	int sum,n;
	double a,b;
	double m;
	char str[100];

	for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
		sscanf(str,"%lf %lf %d",&a,&b,&n);
		sum=0;
		m=(a/b);
		m=fmod(m,1.0);	
		while(n--){
			m*=10;
			sum+=(m)/1;
			m=fmod(m,1.0);	
????????????????????????????????????if(m=0) break;

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

Compiler output:
main.c: In function 'main':
main.c:18:1: error: expected expression before '?' token
   18 | ????????????????????????????????????if(m=0) break;
      | ^
Language: C

#include <stdio.h>
#include <math.h>
int main(void){
	int sum,n;
	double a,b;
	double m;
	char str[100];

	for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
		sscanf(str,"%lf %lf %d",&a,&b,&n);
		sum=0;
		m=(a/b);
		m=fmod(m,1.0);	
		while(n--){
			m*=10;
			sum+=(m)/1;
			m=fmod(m,1.0);	
????????????????????????????????????if(m=0) break;
		}
		printf("%d\n",sum);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:1: error: expected expression before '?' token
   18 | ????????????????????????????????????if(m=0) break;
      | ^
Language: C

#include <stdio.h>
#include <math.h>
int main(void){
	int sum,n;
	double a,b;
	double m;
	char str[100];

	for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
		sscanf(str,"%lf %lf %d",&a,&b,&n);
		sum=0;
		m=(a/b);
		m=fmod(m,1.0);	
		while(n--){
			m*=10;
			sum+=(m)/1;
			m=fmod(m,1.0);	
????????????????????????????????????
		}
		printf("%d\n",sum);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:1: error: expected expression before '?' token
   18 | ????????????????????????????????????
      | ^
Language: C

#include <stdio.h>
#define rep(i,j,k) for(i = j;i <= k;i++)

int main(){
  int a,b,n,amari;
  while(scanf("%d%d%d",&a,&b,&n) != EOF){
    int i,sum,temp;
    amari = a - (a / b) * b;
    sum = 0;
    rep(i,1,n){
      temp = (amari * 10) / b
      sum += temp;
      amari = amari*10 - b*temp;
    }
    printf("%d\n",sum);
  }    
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:30: error: expected ';' before 'sum'
   11 |       temp = (amari * 10) / b
      |                              ^
      |                              ;
   12 |       sum += temp;
      |       ~~~
Language: C

#include <Stdio.h>

int sum ( int a , int b , int n ) {
	int i , sum = 0;
	
	while ( a > b ) {
		a /= b;
	}
	
	for ( i = 0; i < n; i++ ) {
		if ( a < b ) a *= 10;
		sum += a / b;
		a = a % b;
	}
	return sum;
}

int main (void) {
	int a , b , n;
	while ( scanf("%d %d %d",&a,&b,&n) != EOF ) {
		int ans;
		ans = sum(a,b,n);
		printf("%d\n",ans);
	}
	return 0;
}

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

main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 's' defaults to 'int' [-Wimplicit-int]
main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      |                         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      |                         ^~~~~
main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:45: error: invalid operands to binary & (have 'int *' and 'int')
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      |                                           ~~^
      |                                           |
      |                                           int *
main.c:1:49: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      |                                                 ^~~~~~
main.c:1:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:49: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:49: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:87: error: 'sum' undeclared (first use in this function)
    1 | main(a,b,n,s){for(;s=0,~scanf("%d%d%d",&a,&b&n);printf("%d\n",s))for(a%=b;n;--n)a*=10,sum+=a/b,a%=b;}
      |                                                                                       ^~~
main.c:1:87: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
	int a,b,c,i,j,r;
	while(scanf("%d%d%d",&a,&b,&c)==3)
	{
		r=0;
		for(i=0;i<c;i++)
		{
			a<b?a*=10:a=a/b*10;
			j=a/b;
			r+=j;
			if((a-=b*j)==0)
				break;
		}
		printf("%d\n",r);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:36: error: lvalue required as left operand of assignment
   10 |                         a<b?a*=10:a=a/b*10;
      |                                    ^
Language: C

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


int main(){
	
	int a, b;
	double c;
	char str[100];
	int n, s;
	
	int i;
	
	while(1){
		
		ret = scanf("%d %d %d", &a, &b, &n);
		
		if(ret == EOF){
			
			break;
			
		}
		
		s = 0;
		c = (double)a/(double)b;
		str[0] = '\0';
		
		snprintf(str, sizeof(str), "%f", c);
		
		for(i=2; i<n+2; i++){
			
			s += (str[i]-'0');
			
		}
		
		printf("%d\n", s);
		
	}
	
}

Compiler output:
main.c: In function 'main':
main.c:16:17: error: 'ret' undeclared (first use in this function)
   16 |                 ret = scanf("%d %d %d", &a, &b, &n);
      |                 ^~~
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;

int main(){

  int a, b, n, sum;
  double c;
  
  while(cint >> a >> b >> n){
    sum = 0;
    c = a / b;
    for(int i=0; i<n; i++, c * 10){
      sum += (int)c % 10;
    }
    
    cout << sum << endl;
  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cint' was not declared in this scope; did you mean 'uint'?
    9 |   while(cint >> a >> b >> n){
      |         ^~~~
      |         uint
Language: C++

#include <iostream>
using namespace std;
const int INF=1<<29;
signed main(){
int a, b, c; 
while(cin >> a){
cin >> b >> c;
int s=0
for(int i=10;a*i<INF;i*=10) s+=a*i%10;
cout << s << endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: expected ',' or ';' before 'for'
    9 | for(int i=10;a*i<INF;i*=10) s+=a*i%10;
      | ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 | for(int i=10;a*i<INF;i*=10) s+=a*i%10;
      |                ^
Language: C++

#include<stdio.h>

int main(){

double s=0;
int d=10;
int A=0:
int n;
double a,b;

while(scanf("%lf %lf %d",&a,&b,&n)!=EOF){
int S=0;
for(int i=0;i<n;i++)
{s=a/b;
A=(int)A;
s-=A;
s*=10;
A=(int)A;
S+=A;
}
printf("%d\n",S);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: expected ',' or ';' before ':' token
    7 | int A=0:
      |        ^
a.cc:11:33: error: 'n' was not declared in this scope
   11 | while(scanf("%lf %lf %d",&a,&b,&n)!=EOF){
      |                                 ^
Language: C++

int main(){
	int a,b,n;
	while(cin>>a>>b>>n){
		int ans = 0;
		a %= b;
		for(int i = 0; i < n; i++){
			a *= 10;
			ans += a/b;
			a %= b;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:15: error: 'cin' was not declared in this scope
    3 |         while(cin>>a>>b>>n){
      |               ^~~
a.cc:11:17: error: 'cout' was not declared in this scope
   11 |                 cout<<ans<<endl;
      |                 ^~~~
a.cc:11:28: error: 'endl' was not declared in this scope
   11 |                 cout<<ans<<endl;
      |                            ^~~~
Language: C++

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

int main(){
  int a,b,n;
  while(cin >> a >> b >> n){
    int k = a % b * 10;
    s = 0;
    for(int i=0;i<n;i++){
      s += k / b;
      k = k % b * 10;
    }
    cout << s << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 's' was not declared in this scope
    8 |     s = 0;
      |     ^
Language: C++

object Main{
  def main(args: Array[String]): Unit = {
    var sc = new java.util.Scanner(System.in)
    while(sc.hasNext){
      var a:Double = sc.nextDouble
      var b:Double = sc.nextDouble
      var n:Int = sc.nextInt
      var nor:String = (a/b - Math.floor(a/b)).toString() + "00000000"
      var list = new Array[Int](n)
      for(i <- 0 until n){
        list(i) = nor.charAt(i + 2) - '0'
      }
      println(list.sum.toInt)
    }
  }
}

Compiler output:
a.cc:1:1: error: 'object' does not name a type
    1 | object Main{
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  double a,b,c;
  while(cin>>a>>b>>c){
    int sum=0;
    a=a%b*10;
    while(c--){
      sum+=a/b;
      a=a%b*10;
    }
    cout<<sum<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    7 |     a=a%b*10;
      |       ~^~
      |       | |
      |       | double
      |       double
a.cc:10:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   10 |       a=a%b*10;
      |         ~^~
      |         | |
      |         | double
      |         double
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		String str = null;
	    String strSplit = null;
		String[] strs;
		int point = 0;
		int a = 0;
		int b = 0;
		int ans = 0;
		int n = 0;
		double f = 0;

		while(stdin.hasNext()) {
			a = stdin.nextInt();
			b = stdin.nextInt();
			n = stdin.nextInt();
			f = (double)a / (double)b;
 			str = String.valueOf(f);
			point = str.indexOf(".");
			strSplit = str.substring(point + 1);
			strs = strSplit.split("");
			for(int i = 0; i < n; i++) {
				if(i < strs.length) {
					ans += Integer.parseInt(strs[i]);
				}
				
			}
		
			System.out.println(ans);
			ans = 0;
		}
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
using namespace std;int main(){int a,b,n,s,m,i;for(s=0;cin>>a>>b>>n;m=a%b*10){for(i=0;i<n;i++,s+=m/b,m=m%b*10);puts(s);}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:117: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    2 | using namespace std;int main(){int a,b,n,s,m,i;for(s=0;cin>>a>>b>>n;m=a%b*10){for(i=0;i<n;i++,s+=m/b,m=m%b*10);puts(s);}}
      |                                                                                                                     ^
      |                                                                                                                     |
      |                                                                                                                     int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

#include<iostream>main(){for(int a,b,n,s;std::cin>>a>>b>>n;printf("%d\n",s))for(s=0;n-->0;s+=a/b%10)a*=10;}

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<iostream>main(){for(int a,b,n,s;std::cin>>a>>b>>n;printf("%d\n",s))for(s=0;n-->0;s+=a/b%10)a*=10;}
      |                       ^
a.cc:1:9: fatal error: iostream>mai: No such file or directory
    1 | #include<iostream>main(){for(int a,b,n,s;std::cin>>a>>b>>n;printf("%d\n",s))for(s=0;n-->0;s+=a/b%10)a*=10;}
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String args[]) {
		while(sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int n = sc.nextInt();
			int sum = 0;
			for(int i = 0; i < n; i++) {
				a *= 10;
				sum += (a / b) % 10;
				a %= b;
			}
			System.out.println(sum);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++


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

public class Main {

	int INF = 1 << 28;
	void run() {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int n = sc.nextInt();
			a = a%b;
			int ans = 0;
			for(int i=0;i<n;i++) {
				a *= 10;
				ans += a/b;
				a = a%b;
			}
			System.out.println(ans);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import static java.util.Arrays.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

a,b,n;main(s){for(;s=~scanf("%d%d%d",&a,&b,&n);printf("%d\n",s))for(s=0,a=a%b;n--;a%=b)a*=10,s+=a/b;}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,n;main(s){for(;s=~scanf("%d%d%d",&a,&b,&n);printf("%d\n",s))for(s=0,a=a%b;n--;a%=b)a*=10,s+=a/b;}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | a,b,n;main(s){for(;s=~scanf("%d%d%d",&a,&b,&n);printf("%d\n",s))for(s=0,a=a%b;n--;a%=b)a*=10,s+=a/b;}
      |           ^