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

#include<iostream>
using namespace std;

int main(){
while(true){
  int iwakurasisetudan;
  int b;
  int c;
  cin>>iwakurasisetudan;
if(iwakurasisetudan==0){break;
}else{  c=1000-a;
  b=c/500;
  c=c%500;
  b=b+c/100;
  c=c%100;
  b=b+c/50;
  c=c%50;
  b=b+c/10;
  c=c%10;
  b=b+c/5;
  c=c%5;
  b=b+c;
  cout<<b<<endl;
}}}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'a' was not declared in this scope
   11 | }else{  c=1000-a;
      |                ^
Language: C++

#include <stdio.h>
int change(int);
int main(void) {
  int money, mai;
  scanf("%d", &money);
  while(money != 0) {
    money = 1000 - money;
    mai = change(money);
    scanf("%d", &money);
  }
  printf("%d\n", mai);
  return 0;
}

int change (kane){
  int count = 0, i = 0;
  int wei[6] = {500, 100, 50, 10, 5, 1};
  while(kane > 0 && i < 6) {
    if((kane / wei[i]) > 0) {
      kane = kane - wei[i];
      printf("%d, %d\n", kane, i);
      count++;
    }
    i++;
  }
  return count;
}

Compiler output:
a.cc:15:17: error: 'int change' redeclared as different kind of entity
   15 | int change (kane){
      |                 ^
a.cc:2:5: note: previous declaration 'int change(int)'
    2 | int change(int);
      |     ^~~~~~
a.cc:15:13: error: 'kane' was not declared in this scope
   15 | int change (kane){
      |             ^~~~
Language: C++

main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy
if(money >= 500){
 	maisuu = maisuu + 1;
 	money = money - 500 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/100;
 	money =money % 100;
  }
if(money >= 50){
 	maisuu = maisuu + 1;
 	money = money - 50 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/10;
 	money =money % 10;
  }
money = money - buy
if(money >= 5){
 	maisuu = maisuu + 1;
 	money = money - 5 ;
 }
maisuu = maisuu + money;
cout << maisuu << endl;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
    3 | cin >> buy;
      | ^~~
a.cc:4:20: error: expected ';' before 'if'
    4 | money = money - buy
      |                    ^
      |                    ;
    5 | if(money >= 500){
      | ~~                  
a.cc:21:20: error: expected ';' before 'if'
   21 | money = money - buy
      |                    ^
      |                    ;
   22 | if(money >= 5){
      | ~~                  
a.cc:27:1: error: 'cout' was not declared in this scope
   27 | cout << maisuu << endl;
      | ^~~~
a.cc:27:19: error: 'endl' was not declared in this scope
   27 | cout << maisuu << endl;
      |                   ^~~~
Language: C++

main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
 	maisuu = maisuu + 1;
 	money = money - 500 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/100;
 	money =money % 100;
  }
if(money >= 50){
 	maisuu = maisuu + 1;
 	money = money - 50 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/10;
 	money =money % 10;
  }
money = money - buy
if(money >= 5){
 	maisuu = maisuu + 1;
 	money = money - 5 ;
 }
maisuu = maisuu + money;
cout << maisuu << endl;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
    3 | cin >> buy;
      | ^~~
a.cc:21:20: error: expected ';' before 'if'
   21 | money = money - buy
      |                    ^
      |                    ;
   22 | if(money >= 5){
      | ~~                  
a.cc:27:1: error: 'cout' was not declared in this scope
   27 | cout << maisuu << endl;
      | ^~~~
a.cc:27:19: error: 'endl' was not declared in this scope
   27 | cout << maisuu << endl;
      |                   ^~~~
Language: C++

#include <iostream>
main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
 	maisuu = maisuu + 1;
 	money = money - 500 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/100;
 	money =money % 100;
  }
if(money >= 50){
 	maisuu = maisuu + 1;
 	money = money - 50 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/10;
 	money =money % 10;
  }
money = money - buy
if(money >= 5){
 	maisuu = maisuu + 1;
 	money = money - 5 ;
 }
maisuu = maisuu + money;
cout << maisuu << endl;
return 0;
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | cin >> buy;
      | ^~~
      | 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:22:20: error: expected ';' before 'if'
   22 | money = money - buy
      |                    ^
      |                    ;
   23 | if(money >= 5){
      | ~~                  
a.cc:28:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 | cout << maisuu << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:28:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   28 | cout << maisuu << endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/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;
main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
 	maisuu = maisuu + 1;
 	money = money - 500 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/100;
 	money =money % 100;
  }
if(money >= 50){
 	maisuu = maisuu + 1;
 	money = money - 50 ;
 }
if(money >= 100){
 	maisuu = maisuu + money/10;
 	money =money % 10;
  }
money = money - buy
if(money >= 5){
 	maisuu = maisuu + 1;
 	money = money - 5 ;
 }
maisuu = maisuu + money;
cout << maisuu << endl;
return 0;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:20: error: expected ';' before 'if'
   23 | money = money - buy
      |                    ^
      |                    ;
   24 | if(money >= 5){
      | ~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
using namespace std;
int main()
{
	int a = 0;
	int b;
	int c = 0;
	for (; a != 0;)
	{
		cin >> a;
		b = a;
		for (; b != 0;)
		{
			if (b >= 500)
			{
				b = b - 500;
				c++;
			}
			if (b >= 100)
			{
				b = b - 100;
				c++;
			}
			if (b >= 50)
			{
				b = b - 50;
				c++;
			}
			if (b >= 10)
			{
				b = b - 10;
				c++;
			}
			if (b >= 5)
			{
				b = b - 5;
				c++;
			}
			if (b >= 1)
			{
				b = b - 1;
				c++;
			}
			cout<<c<<endl
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:38: error: expected ';' before '}' token
   49 |                         cout<<c<<endl
      |                                      ^
      |                                      ;
   50 |                 }
      |                 ~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int all, rem, count = 0, tmp;
	while (1) {
		cin >> all;
		if (all == 0)
			break;
		rem = 1000 - all;
		if (rem >= 500) {
			count = count + 1;
			rem = rem - 500;
		}
		if (rem >= 100) {
			tmp = rem / 100;
			count = count + tmp;
			rem = rem - (100 * tmp);
		}
		if (rem >= 50) {
			tmp = rem / 50;
			count = count + tmp;
			rem = rem - 50 * tmp;
		}
		if (rem >= 10) {
			tmp = rem / 10;
			count = count + tmp;
			rem = rem - 10 * tmp;
		}
		if (rem >= 5) {
			tmp = rem / 5;
			count = count + tmp;
			rem = rem - 5 * tmp;
		}
		count = count + rem;
		cout << count << endl;
		return 0;
	}
	return 0;

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

#include<iostream>
using namespace std;

int main(){
int total;
int change;
int count=0;
while(true){
 cin>>total;
 if(total==0){
    break;
  } 
 change=1000-total;
 while(true){
   if(change>=500){
     change-=500;
     count++;
   }else if(change>=100){
     change-=100;
     count++;
   }else if(change>=50){
     change-=50;
     count++;
   }else if(change>=10){
     change-=10;
     count++;
   }else if(change>=5){
     change-=5;
     count++;
   }else{
     change--;
     count++;
    }
 }
 count<<count<<"\n";
 count=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   35 |  count<<count<<"\n";
      |  ~~~~~~~~~~~~^~~~~~
      |       |        |
      |       int      const char [2]
Language: C++

#include<iostream>
using namespace std;

int main(){
	int m,t;
	int p=0;
	cin >> m;
	if(m==0){
		break;
	}
	t=1000-m;
	while(1){
	if(t>=500){
	t-=500;	
	p++;
	}else if(t>=100){
	t-=100;
	p++;
	}else if(t>=50){
	t-=50;
	p++;
	}else if(t>=10){
	t-=10;
	p++;
	}else if(t>=5){
	t-=5;
	p++;
	}else{
	t--;
	p++;
		}
	if(t==0){
		break;
	}	
	}
	cout << p << '\n';
	count=0;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: break statement not within loop or switch
    9 |                 break;
      |                 ^~~~~
a.cc:37:9: error: 'count' was not declared in this scope
   37 |         count=0;
      |         ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
int buy,oturi,kouka;
while(1){
cin>>buy;
if(buy==0){
break;
}
oturi=1000-buy;
if(oturi>500){
oturi-=500;
kouka+=1;
}
while(oturi>=100){
oturi-=100;
kouka+=1;
}
while(oturi>=50){
oturi-=50;
kouka+=1;
}
while(oturi>=10){
oturi-=10;
kouka+=1;
}
while(oturi>=5){
oturi-=5;
kouka+=1;
}
while(oturi>=1){
oturi-=1;
kouka+=1;
}
cout<<kouka<<'\n';
}
}
return 0;
}

Compiler output:
a.cc:39:1: error: expected unqualified-id before 'return'
   39 | return 0;
      | ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n;while(true){cin>>n;if(n==0){break;}
cout<<n/500+(n/100)%5+(n/50)%2+(n/10)%5+(n/5)%2+n%5<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:60: error: expected '}' at end of input
    5 | cout<<n/500+(n/100)%5+(n/50)%2+(n/10)%5+(n/5)%2+n%5<<endl;}
      |                                                            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

 
int main () 
{
  int m1;
  while(1)
  {
   cin>>m1; 
   if(m1>0||m1<1000)
   {
       break;
   }
   else
   {
   int m2,m3,m4,m5,m6,m7;
   }
   m2=1000-m1;
   m3=m2/500;
   m4=m2%500/100;
   m5=m2%500%100/50;
   m6=m2%500%100%50/10;
   m7=m2%500%100%50%10/1;
  } 
   
  return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'm2' was not declared in this scope; did you mean 'm1'?
   19 |    m2=1000-m1;
      |    ^~
      |    m1
a.cc:20:4: error: 'm3' was not declared in this scope; did you mean 'm1'?
   20 |    m3=m2/500;
      |    ^~
      |    m1
a.cc:21:4: error: 'm4' was not declared in this scope; did you mean 'm1'?
   21 |    m4=m2%500/100;
      |    ^~
      |    m1
a.cc:22:4: error: 'm5' was not declared in this scope; did you mean 'm1'?
   22 |    m5=m2%500%100/50;
      |    ^~
      |    m1
a.cc:23:4: error: 'm6' was not declared in this scope; did you mean 'm1'?
   23 |    m6=m2%500%100%50/10;
      |    ^~
      |    m1
a.cc:24:4: error: 'm7' was not declared in this scope; did you mean 'm1'?
   24 |    m7=m2%500%100%50%10/1;
      |    ^~
      |    m1
Language: C++

#include <iostream>
using namespace std;

 
int main () 
{
  int m1;
  while(1)
  {
   cin>>m1; 
   if(m1>0||m1<=1000)
   {
       break;
   }
   else
    {
    int m2,m3,m4,m5,m6,m7;
    }
   m2=1000-m1;
   m3=m2/500;
   m4=m2%500/100;
   m5=m2%500%100/50;
   m6=m2%500%100%50/10;
   m7=m2%500%100%50%10/1;
  
   cout<<m3+m4+m5+m6+m7<<'\n';
 }
   
  return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'm2' was not declared in this scope; did you mean 'm1'?
   19 |    m2=1000-m1;
      |    ^~
      |    m1
a.cc:20:4: error: 'm3' was not declared in this scope; did you mean 'm1'?
   20 |    m3=m2/500;
      |    ^~
      |    m1
a.cc:21:4: error: 'm4' was not declared in this scope; did you mean 'm1'?
   21 |    m4=m2%500/100;
      |    ^~
      |    m1
a.cc:22:4: error: 'm5' was not declared in this scope; did you mean 'm1'?
   22 |    m5=m2%500%100/50;
      |    ^~
      |    m1
a.cc:23:4: error: 'm6' was not declared in this scope; did you mean 'm1'?
   23 |    m6=m2%500%100%50/10;
      |    ^~
      |    m1
a.cc:24:4: error: 'm7' was not declared in this scope; did you mean 'm1'?
   24 |    m7=m2%500%100%50%10/1;
      |    ^~
      |    m1
Language: C++

#include<iostream>
using namespace std;
int main(){
int siharai,oturi=1;
int a,b,c,d,e,f;

while(oturi!=0){
cin>>siharai;
oturi=1000-siharai;

if(oturi>=500){
a=1;
oturi=oturi-500;
}
else{
a=0;
}

while(oturi>=100){
if(oturi>=100){
b=1;
oturi=oturi-100;
}
else
a=0;
}

while(oturi>=50){
if(oturi>=50){
c=1;
oturi=oturi-50;
}
else
c=0;
}

while(oturi>=10){
if(oturi>=10){
d=1;
oturi=oturi-10;
}
else
d=0;
}

while(oturi>=5){
if(oturi>=5){
e=1;
oturi=oturi-5;
}
else
e=0;
}

while(oturi>=1){
if(oturi>=1){
f=1;
oturi=oturi-1;
}
else
f=0;
}
}
cout<<a+b+c+d+e+f<<'\n';
return 0;

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

#include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1];
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
      |                         ^~~
a.cc:4:28: error: expected ']' before ',' token
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
      |                            ^
      |                            ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
      |                        ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
      |                             ^~~
a.cc:9:5: error: 'i' was not declared in this scope
    9 | for(i=0;i<6;i++){
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
      |                         ^~~
a.cc:4:28: error: expected ']' before ',' token
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
      |                            ^
      |                            ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
      |                        ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
      |                             ^~~
a.cc:9:5: error: 'i' was not declared in this scope
    9 | for(i=0;i<6;i++){
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
      |                         ^~~
a.cc:4:28: error: expected ']' before ',' token
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
      |                            ^
      |                            ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
      |                        ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
    4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
      |                             ^~~
a.cc:9:5: error: 'i' was not declared in this scope
    9 | for(i=0;i<6;i++){
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int price,cnt=0;
int div[6]=[500,100,50,10,5,1];
int i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected identifier before numeric constant
    5 | int div[6]=[500,100,50,10,5,1];
      |             ^~~
a.cc:5:16: error: expected ']' before ',' token
    5 | int div[6]=[500,100,50,10,5,1];
      |                ^
      |                ]
a.cc: In lambda function:
a.cc:5:16: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:5:12: error: array must be initialized with a brace-enclosed initializer
    5 | int div[6]=[500,100,50,10,5,1];
      |            ^~~~
a.cc:5:17: error: expected unqualified-id before numeric constant
    5 | int div[6]=[500,100,50,10,5,1];
      |                 ^~~
Language: C++

#include <cstdio>
using namespace std;
int main()
{while(1){
 int a;
 scanf("%d",&a);
if(a==0) return 0;
 a=1000-a;
 printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: unable to find numeric literal operator 'operator""a'
    9 |  printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5;}
      |                  ^~~~
Language: C++

#include <cstdio>
using namespace std;
int main()
{while(1){
 int a;
 scanf("%d",&a);
if(a==0) return 0;
 a=1000-a;
 printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5);}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: unable to find numeric literal operator 'operator""a'
    9 |  printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5);}
      |                  ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int money,count,maisu = 0,oturi[1000] = {};
  int money2[6] = {500,100,50,10,5,1};

  for(int i = 0;i >= 0;i++){
    cin >> money;
    count++;
    if(money == 0)
      break;
    oturi[] = 1000 - money;
  }

  for(int j = 0;j < count;j++){ 
    for(int i = 0;i < 6;i++){
      maisu += oturi[j] / money2[i];
      oturi[j] %= money2[i];
    }
  }
  cout << maisu << endl;
    
    return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected primary-expression before ']' token
   13 |     oturi[] = 1000 - money;
      |           ^
Language: C++

#include <stdio.h>

int main(){
	int okane;
	int oturi;
	int count = 0;
	int a[] = { 1, 5, 10, 50, 100, 500 };

	scanf_s("%d", &okane);
	oturi = 1000 - okane;

	for (int i = 5; i >= 0; i--){
		if (okane >= a[i]){
			okane = okane - a[i];
			count = count + 1;
		}
	}
	printf("%d\n",count);
	return 0;

}

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

#include <stdio.h>

void main(){
	int okane;
	int oturi;
	int count = 0;
	int a[] = { 1, 5, 10, 50, 100, 500 };

	scanf_s("%d", &okane);
	oturi = 1000 - okane;

	for (int i = 5; i >= 0; i--){
		if (okane >= a[i]){
			okane = okane - a[i];
			count = count + 1;
		}
	}
	printf("%d\n",count);

}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d", &okane);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>

void main(){
	int okane;
	int oturi;
	int count = 0;
	int a[] = { 1, 5, 10, 50, 100, 500 };

	scanf("%d", &okane);
	oturi = 1000 - okane;

	for (int i = 5; i >= 0; i--){
		if (okane >= a[i]){
			okane = okane - a[i];
			count = count + 1;
		}
	}
	printf("%d\n",count);

}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

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

int main(){
	int okane;
	int oturi;
	int count = 0;
	int a[] = { 1, 5, 10, 50, 100, 500 };

	scanf_s("%d", &okane);
	oturi = 1000 - okane;

	for (int i = 5; i >= 0; i--){
		if (oturi >= a[i]){
			div_t d;

			d = div(oturi, a[i]);
			oturi = oturi - a[i] * d.quot;
			count = count + d.quot;
		}
	}
	printf("%d\n",count);

	return 0;

	div(20, 3);

}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
p=1000,s=0;
  p-=n;
  s+=p/500;
  p%=500;
  s+=p/100;
  p%=100;
  s+=p/50;
  p%=50;
  s+=p/10;
  p%=10;
  s+=p/5;
  p%=5;
  s+=p/1;
  p%=1;
  cout<<s<<endl;}

}

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

???#include <bits/stdc++.h>

#define MP make_pair
#define PB push_back
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define PB push_back

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVi;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;

int main(){
	ios::sync_with_stdio(false);
    int sum=0;
    int x;
    int cnt=0;
    while(1){
        cin>>x;
        if(!x)
            return 0;
        sum=1000-x;
        while(sum>0){
            if(sum>=500){
                cnt++;
                sum-=500;
            }
            else if(sum>=100){
                cnt++;
                sum-=100;
            }
            else if(sum>=50){
                cnt++;
                sum-=50;
            }
            else if(sum>=10){
                cnt++;
                sum-=10;
            }
            else if(sum>=5){
                cnt++;
                sum-=5;
            }
            else{
                cnt++;
                sum-=1;
            }
        }
        cout<<cnt<<endl;
        cnt=0;
    }


    return 0;
}

Compiler output:
a.cc:1:4: error: stray '#' in program
    1 | ???#include <bits/stdc++.h>
      |    ^
a.cc:1:1: error: expected unqualified-id before '?' token
    1 | ???#include <bits/stdc++.h>
      | ^
a.cc:19:9: error: 'vector' does not name a type
   19 | typedef vector<int> VI;
      |         ^~~~~~
a.cc:20:9: error: 'vector' does not name a type
   20 | typedef vector<VI > VVi;
      |         ^~~~~~
a.cc:21:9: error: 'vector' does not name a type
   21 | typedef vector<string> VS;
      |         ^~~~~~
a.cc:22:9: error: 'vector' does not name a type
   22 | typedef vector<LL> VLL;
      |         ^~~~~~
a.cc:23:9: error: 'pair' does not name a type
   23 | typedef pair<int,int> PII;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:30:9: error: 'ios' has not been declared
   30 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:35:9: error: 'cin' was not declared in this scope
   35 |         cin>>x;
      |         ^~~
a.cc:65:9: error: 'cout' was not declared in this scope
   65 |         cout<<cnt<<endl;
      |         ^~~~
a.cc:65:20: error: 'endl' was not declared in this scope
   65 |         cout<<cnt<<endl;
      |                    ^~~~
Language: C++

// ???#include <bits/stdc++.h>
#include <iostream>

// #define MP make_pair
// #define PB push_back
// #define ALL(x)  (x).begin(),(x).end()
// #define RALL(x) (x).rbegin(),(x).rend()
// #define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
// #define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
// #define rep(i, N)  for (int i = 0; i < (int)(N); i++)
// #define rrep(i, N) for (int i = N - 1; i >= 0; i--)
// #define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
// #define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
// #define PB push_back

using namespace std;

// typedef long long LL;
// typedef unsigned long long ULL;
// typedef vector<int> VI;
// typedef vector<VI > VVi;
// typedef vector<string> VS;
// typedef vector<LL> VLL;
// typedef pair<int,int> PII;

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;

int main(){
	ios::sync_with_stdio(false);
    int sum=0;
    int x;
    int cnt=0;
    while(1){
        cin>>x;
        if(!x)
            return 0;
        sum=1000-x;
        while(sum>0){
            if(sum>=500){
                cnt++;
                sum-=500;
            }
            else if(sum>=100){
                cnt++;
                sum-=100;
            }
            else if(sum>=50){
                cnt++;
                sum-=50;
            }
            else if(sum>=10){
                cnt++;
                sum-=10;
            }
            else if(sum>=5){
                cnt++;
                sum-=5;
            }
            else{
                cnt++;
                sum-=1;
            }
        }
        cout<<cnt<<endl;
        cnt=0;
    }


    return 0;
}

Compiler output:
a.cc:27:7: error: 'LL' does not name a type
   27 | const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
      |       ^~
Language: C++

#include <iostream>

using namespace std;

int main() {
    ios::sync_with_std(false);
    int n[5], count=0;

    for (int i=0; i<5; i++) cin >> n[i];

    for (int i=0;i<5;i++) {
	if(n[i] == 0) break;

	int s=1000 - n[i];

	int j = (s - s % 500)/500;
        count += j;
	s -= j*500;
        j = (s - s % 100)/100;
        count += j;
	s -= j*100;
        j = (s - s % 100)/100;
        count += j;
	s -= j*50;
        j = (s - s % 50)/50;
        count += j;
	s -= j*10;
        j = (s - s % 10)/10;
        count += j;
	s -= j*10;
        j = (s - s % 5)/5;
        count += j;
	s -= j*5;
        count += s;

	cout << count << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'sync_with_std' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
    6 |     ios::sync_with_std(false);
      |          ^~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    int n[5], count=0, coin = { 500,100,50,10,5 };

    for (int i=0; i<5; i++) cin >> n[i];

    for (int i=0;i<5;i++) {
	if(n[i] == 0) break;

	int s=1000 - n[i];

	for (int j=0;j<5;j++) {
	   int m = s / coin[j];
	   count += m;
	   s -= m * coin[j];
	}

	count += s;
	cout << count << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: scalar object 'coin' requires one element in initializer
    7 |     int n[5], count=0, coin = { 500,100,50,10,5 };
      |                        ^~~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	int coin=0;
	int price=0;
	int flag=0;
	cin>>price;
	price=1000-price;
	while(1){
		if(flag==1){
			break;
		}
		if(price>=500){
			price=price-500;
			coin=coin+1;
		}
		else if(price>=100){
			price=price-100;
			coin=coin+1;
		}
		else if(price>=50){
			price=price-50;
			coin=coin+1 ;
		}
		else if(price>=10){
			price=price-10;
			coin=coin+1 ;
		}
		else if(price>=5){
			price=price-5;
			coin=coin+1 ;
		}
		else if(price>=1){
			price=price-1;
			coin=coin+1 ;
		}
		else if(price==0){
			flag=1;
		}
	}
	if(coins!=0){
	cout<<coin<<endl;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:12: error: 'coins' was not declared in this scope; did you mean 'coin'?
   42 |         if(coins!=0){
      |            ^~~~~
      |            coin
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int V[6]={1,5,10,50,100,500};
int C[6],A;

void main(){
  int ans=0;
  for(int i=5;i>=0;i--){
    int t=min(A/V[i],C[i]);
    A-=t*V[i];
    ans+=t;
  }
  printf("%d\n",ans);
}


Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main(){
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int V[6]={1,5,10,50,100,500};
int C[6],A;

void main(){
  int ans=0;
  for(int i=5;i>=0;i--){
    int t=min(A/V[i],C[i]);
    A-=t*V[i];
    ans+=t;
  }
  printf("%d\n",ans);
  return 0;
}


Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	while(1){
	int n;
	cin>>n;
	if(n==0)break;
	int a,b,c,d,e,f,g;
	g=1000-n;
	for(a=0;a<2;a++){
		for(b=0;b<5;b++){
			for(c=0;c<2;c++){
				for(d=0;d<5;d++){
					for(e=0;e<2;e++){
						for(f=0;f<5;f++){
							if(a*500+b*100+c*50+d*10+e*5+f==g){
								cout<<a+b+c+d+e+f<<endl;
								break;
							}
						}
					}
				}
			}
		}
	}
	return 0;
}							


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

#include<iostream>
using namespase std;

int main(
	int n,m;
	cin >> n;

	n = 1000 - n;
	m = 0;

	if ( n >= 500) {
		m = m + 1;
	}
	if ( n >= 100) {
		m = m + (n / 100);
	}
	if (n >= 50) {
		m = m + (n / 50);
	}
	if (n >= 10) {
		m = m + (n / 10);
	}
	if (n >= 5) {
		m = m + (n / 5);
	}
	if (n >= 1) {
		m = m + (n / 1);
	}

	cout << m << endl;

	return 0;
)


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc:5:15: error: 'm' has not been declared
    5 |         int n,m;
      |               ^
a.cc:5:16: error: expected ')' before ';' token
    5 |         int n,m;
      |                ^
      |                )
a.cc:4:9: note: to match this '('
    4 | int main(
      |         ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
    4 | int main(
      |     ^~~~
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin >> n;
      |         ^~~
a.cc:8:9: error: 'n' does not name a type
    8 |         n = 1000 - n;
      |         ^
a.cc:9:9: error: 'm' does not name a type; did you mean 'tm'?
    9 |         m = 0;
      |         ^
      |         tm
a.cc:11:9: error: expected unqualified-id before 'if'
   11 |         if ( n >= 500) {
      |         ^~
a.cc:14:9: error: expected unqualified-id before 'if'
   14 |         if ( n >= 100) {
      |         ^~
a.cc:17:9: error: expected unqualified-id before 'if'
   17 |         if (n >= 50) {
      |         ^~
a.cc:20:9: error: expected unqualified-id before 'if'
   20 |         if (n >= 10) {
      |         ^~
a.cc:23:9: error: expected unqualified-id before 'if'
   23 |         if (n >= 5) {
      |         ^~
a.cc:26:9: error: expected unqualified-id before 'if'
   26 |         if (n >= 1) {
      |         ^~
a.cc:30:9: error: 'cout' does not name a type
   30 |         cout << m << endl;
      |         ^~~~
a.cc:32:9: error: expected unqualified-id before 'return'
   32 |         return 0;
      |         ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
   33 | )
      | ^
Language: C++

#include<iostream>
#using namespase std;
 
int main(
    int n,m;
    cin >> n;
 
    n = 1000 - n;
    m = 0;
 
    if ( n >= 500) {
        m = m + 1;
    }
    if ( n >= 100) {
        m = m + (n / 100);
    }
    if (n >= 50) {
        m = m + (n / 50);
    }
    if (n >= 10) {
        m = m + (n / 10);
    }
    if (n >= 5) {
        m = m + (n / 5);
    }
    if (n >= 1) {
        m = m + (n / 1);
    }
 
    cout << m << endl;
 
    return 0;
)


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #using
    2 | #using namespase std;
      |  ^~~~~
a.cc:5:11: error: 'm' has not been declared
    5 |     int n,m;
      |           ^
a.cc:5:12: error: expected ')' before ';' token
    5 |     int n,m;
      |            ^
      |            )
a.cc:4:9: note: to match this '('
    4 | int main(
      |         ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
    4 | int main(
      |     ^~~~
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin >> n;
      |     ^~~
a.cc:8:5: error: 'n' does not name a type
    8 |     n = 1000 - n;
      |     ^
a.cc:9:5: error: 'm' does not name a type; did you mean 'tm'?
    9 |     m = 0;
      |     ^
      |     tm
a.cc:11:5: error: expected unqualified-id before 'if'
   11 |     if ( n >= 500) {
      |     ^~
a.cc:14:5: error: expected unqualified-id before 'if'
   14 |     if ( n >= 100) {
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'if'
   17 |     if (n >= 50) {
      |     ^~
a.cc:20:5: error: expected unqualified-id before 'if'
   20 |     if (n >= 10) {
      |     ^~
a.cc:23:5: error: expected unqualified-id before 'if'
   23 |     if (n >= 5) {
      |     ^~
a.cc:26:5: error: expected unqualified-id before 'if'
   26 |     if (n >= 1) {
      |     ^~
a.cc:30:5: error: 'cout' does not name a type
   30 |     cout << m << endl;
      |     ^~~~
a.cc:32:5: error: expected unqualified-id before 'return'
   32 |     return 0;
      |     ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
   33 | )
      | ^
Language: C++

#include<iostream>
using namespace std;
  
int main(
    int n,m;
    cin >> n;
  
    n = 1000 - n;
    m = 0;
  
    if ( n >= 500) {
        m = m + 1;
    }
    if ( n >= 100) {
        m = m + (n / 100);
    }
    if (n >= 50) {
        m = m + (n / 50);
    }
    if (n >= 10) {
        m = m + (n / 10);
    }
    if (n >= 5) {
        m = m + (n / 5);
    }
    if (n >= 1) {
        m = m + (n / 1);
    }
  
    cout << m << endl;
  
    return 0;
)


Compiler output:
a.cc:5:11: error: 'm' has not been declared
    5 |     int n,m;
      |           ^
a.cc:5:12: error: expected ')' before ';' token
    5 |     int n,m;
      |            ^
      |            )
a.cc:4:9: note: to match this '('
    4 | int main(
      |         ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
    4 | int main(
      |     ^~~~
a.cc:6:5: error: 'cin' does not name a type
    6 |     cin >> n;
      |     ^~~
a.cc:8:5: error: 'n' does not name a type
    8 |     n = 1000 - n;
      |     ^
a.cc:9:5: error: 'm' does not name a type; did you mean 'tm'?
    9 |     m = 0;
      |     ^
      |     tm
a.cc:11:5: error: expected unqualified-id before 'if'
   11 |     if ( n >= 500) {
      |     ^~
a.cc:14:5: error: expected unqualified-id before 'if'
   14 |     if ( n >= 100) {
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'if'
   17 |     if (n >= 50) {
      |     ^~
a.cc:20:5: error: expected unqualified-id before 'if'
   20 |     if (n >= 10) {
      |     ^~
a.cc:23:5: error: expected unqualified-id before 'if'
   23 |     if (n >= 5) {
      |     ^~
a.cc:26:5: error: expected unqualified-id before 'if'
   26 |     if (n >= 1) {
      |     ^~
a.cc:30:5: error: 'cout' does not name a type
   30 |     cout << m << endl;
      |     ^~~~
a.cc:32:5: error: expected unqualified-id before 'return'
   32 |     return 0;
      |     ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
   33 | )
      | ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
	/*
	//数あて
	int n;
	cin >> n;
	int p[200][3];

	for(int i=0;i<n;i++)
	{
		cin >> p[i][0] >> p[i][1] >> p[i][2];
	}

	int _p;
	for(int k=0;k<3;k++)
	{
		for(int i=0;i<n;i++)
		{
			_p = p[i][k];
			for(int j=i+1;j<n;j++)
			{
				if(_p == p[j][k])
				{
					p[i][k] = 0;
					p[j][k] = 0;
				}
			}
		}
	}

	for(int i=0;i<n;i++)
	{
		cout << p[i][0] + p[i][1] + p[i][2] << endl;
	}
	*/

	/*
	//得点
	int ai,am,as,ae,bi,bm,bs,be;
	cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
	int answer=ai+am+as+ae;
	if(answer < bi+bm+bs+be)
	{
		answer=bi+bm+bs+be;
	}
	cout << answer << endl;
	*/
	
	//おつり
	int onum;
	int i = 0;
	while(true){
		int N;
		cin >> N;
		if(N == 0) break;
				
		int oturi = 1000-N;
		if(oturi >= 500)
		{
			onum++;
			oturi -= 500;
		}
		while(oturi>=100)
		{
			onum++;
			oturi -= 100;
		}
		if(oturi >= 50)
		{
			onum++;
			oturi -= 50;
		}
		while(oturi>=10)
		{
			onum++;
			oturi -= 10;
		}
		if(oturi >= 5)
		{
			onum++;
			oturi -= 5;
		}
		while(oturi>=1)
		{
			onum++;
			oturi -= 1;
		}
		
		i++;
	}
    cout << onum[0] << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:95:17: error: invalid types 'int[int]' for array subscript
   95 |     cout << onum[0] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int coin[]={500,100,50,10,5,1};
int main() {int n,r,i;while(1){cin>>n;if(!n)break;n=1000-n,r=0;for(i=0;i<6;i++)r+=n/coin[i],n%=coin[i];cout<<res<<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:110: error: 'res' was not declared in this scope
    4 | int main() {int n,r,i;while(1){cin>>n;if(!n)break;n=1000-n,r=0;for(i=0;i<6;i++)r+=n/coin[i],n%=coin[i];cout<<res<<endl;}}
      |                                                                                                              ^~~
Language: C++

#import<cstdio>
int main(){
	int i,n,c[]={0,1,5,10,50,100,500};
	for(;*c=0,scanf("%d",&n),n;printf("%d\n",*c)){
		for(n=1000-n,i=6;i;i--){
			for(;n>=c[i];){
				n-=c[i],*c++;
			}
		}
	}
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc: In function 'int main()':
a.cc:7:42: error: lvalue required as increment operand
    7 |                                 n-=c[i],*c++;
      |                                          ^
Language: C++

#include <iostream>

using namespace std;

int main() {

  int value,change;
  int coins;


  while(1) {

    cin >> value;

    if(value==0) break;

    coins=0;
    change=1000-value;

    coins+=change/500;
    change%=500;

    coins+=change/100;
    change%=100;

    coins+=change/50;
    change%=50;

    coins+=change/10;
    change%=10;

    coins+=change/5;
    change%=5;

    coins+=change/1;
    change%=1;

    cout << coinsツ　<< endl;

  }

  return 0;

}

Compiler output:
a.cc:38:13: error: extended character 　 is not valid in an identifier
   38 |     cout << coinsツ　<< endl;
      |             ^
a.cc: In function 'int main()':
a.cc:38:13: error: 'coins\U000030c4\U00003000' was not declared in this scope
   38 |     cout << coinsツ　<< endl;
      |             ^~~~~~~~~
Language: C++

g#include <iostream>

using namespace std;

int main() {
    int n;
    while (cin >> n) {
        if (n == 0) break;
        int change = 1000 - n;
        int count = 0;
        if (change >= 500) {
            change -= 500;
            count++;
        } 
        if (change >= 100) {
            int coin_100 = change / 100;
            change -= 100 * coin_100;
            count += coin_100;
        } 
        if (change >= 50) {
            change -= 50;
            count++;
        }
        if (change >= 10) {
            int coin_10 = change / 10;
            change -= 10 * coin_10;
            count += coin_10;
        }
        if (change >= 5) {
            change -= 5;
            count++;
        }
        count += change;
        cout << count << endl;
    }
    return 0;
}
            

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | g#include <iostream>
      |  ^
a.cc:1:1: error: 'g' does not name a type
    1 | g#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:7:12: error: 'cin' was not declared in this scope
    7 |     while (cin >> n) {
      |            ^~~
a.cc:34:9: error: 'cout' was not declared in this scope; did you mean 'count'?
   34 |         cout << count << endl;
      |         ^~~~
      |         count
a.cc:34:26: error: 'endl' was not declared in this scope
   34 |         cout << count << endl;
      |                          ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
while(cin >> a){
if(n!=0){b=1000-a;
c=0;
if(b=>500){b=b-500; c=c+1;}
if(b=>100){while(b<100){b=b-100; c=c+1;}}
if(b=>50){b=b-50; c=c+1;}
if(b=>10){while(b<10){b=b-10; c=c+1;}}
if(b=>5){b=b-5; c=c+1;}
c=b+c;
cout << c<<endl;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'n' was not declared in this scope
    9 | if(n!=0){b=1000-a;
      |    ^
a.cc:11:6: error: expected primary-expression before '>' token
   11 | if(b=>500){b=b-500; c=c+1;}
      |      ^
a.cc:12:6: error: expected primary-expression before '>' token
   12 | if(b=>100){while(b<100){b=b-100; c=c+1;}}
      |      ^
a.cc:13:6: error: expected primary-expression before '>' token
   13 | if(b=>50){b=b-50; c=c+1;}
      |      ^
a.cc:14:6: error: expected primary-expression before '>' token
   14 | if(b=>10){while(b<10){b=b-10; c=c+1;}}
      |      ^
a.cc:15:6: error: expected primary-expression before '>' token
   15 | if(b=>5){b=b-5; c=c+1;}
      |      ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
while(cin >> a){
if(n!=0){b=1000-a;
c=0;
if(b>=500){b=b-500; c=c+1;}
if(b>=100){while(b<100){b=b-100; c=c+1;}}
if(b>=50){b=b-50; c=c+1;}
if(b>=10){while(b<10){b=b-10; c=c+1;}}
if(b>=5){b=b-5; c=c+1;}
c=b+c;
cout << c<<endl;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'n' was not declared in this scope
    9 | if(n!=0){b=1000-a;
      |    ^
Language: C++

#include <cstdio>
using namespace std;

int main()
{
while(true) {
int n;
scanf("%d", &n);
if(n == 0)
break;
int change = 1000 - n;
int ans = 0;
for(int digit = 1; digit < 1000; mul *= 10) {
int cur = change / digit % 10;
ans += (cur / 5) + (cur % 5);
}
printf("%d\n", ans);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: 'mul' was not declared in this scope
   13 | for(int digit = 1; digit < 1000; mul *= 10) {
      |                                  ^~~
Language: C++

#include <cstdio>

int main (int argc, char const* argv[])
{
	
	int coin[6]={500,100,50,10,5,1};
	
	int a,r=0,m;
	
	while(true){
	
	scanf("%d",&m);
	if(m==0) break;
	m=1000-m;
	r=0
	for(int i=0;i<6;i++){
		a=m/coin[i];
		r+=a;
		m-=(a*coin[i]);
	}
	
	
	printf("%d\n",r);
	
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:12: error: expected ';' before 'for'
   15 |         r=0
      |            ^
      |            ;
   16 |         for(int i=0;i<6;i++){
      |         ~~~ 
a.cc:16:21: error: 'i' was not declared in this scope
   16 |         for(int i=0;i<6;i++){
      |                     ^
Language: C++

#include<iostream>
using namespace std;

int p[6] = {500, 100, 50, 10, 5, 1};

int main(){
	int n;
	while(cin >> n, n){
		ans = 0;
		n = 1000 - n;

		for(int i=0; i < 6; i++){
			ans += n / p[i];
			n -= n / p[i] * p[i];
		}
		cout << ans << endl;
	}
}

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

coin = [500,100,50,10,5,1]
loop do
  n = gets.chomp.to_i
  break if n==0
  n=1000-n
  ans = 0
  for c in coin
    ans+=n/c
    n=n%c
  end
  puts ans
end

Compiler output:
a.cc:1:1: error: 'coin' does not name a type
    1 | coin = [500,100,50,10,5,1]
      | ^~~~
Language: C++

#include<stdio.h>

int mian(void){
	int n,k;

	while(0==0){
		scanf("%d",&n);
		if(n==0)break;
		k=0;
		k += n /500;  n %=500;
		k += n/100;   n %=100;
		k += n/50;    n %= 50;
		k += n/10;    n %= 10;
		k += n/5;     k += n%5;
		printf("%d\n",k);
	}
	return 0;
}

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

#include<stdio.h>
#include<string.h>
#include<windows.h>
int main(){
	int cnt=0,cut=0,i,f;
	char a[1001];
	scanf("%s",a);
	f=strlen(a);
	for(i=0;i<f;i++){
		if(a[i]=='J' && a[i+1]=='O' && a[i+2]=='I')cnt+=1;
		if(a[i]=='I' && a[i+1]=='O' && a[i+2]=='I')cut+=1;
	}
	printf("%d\n%d\n",cnt,cut);
	return 0;
}


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

#include<stdio.h>
int main(void){
	while(scanf("%s",moji)!=EOF){
		int a=0,b=0,i=0;
		char moji[10000];
		while(moji[i+2]!='\0'){
			if(moji[i]=='J' && moji[i+1]=='O' && moji[i+2]=='I')a++;
			else if(moji[i]=='I' && moji[i+1]=='O' && moji[i+2]=='I')b++;
			i++;
		}
		printf("%d\n%d\n",a,b);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:3:26: error: 'moji' undeclared (first use in this function)
    3 |         while(scanf("%s",moji)!=EOF){
      |                          ^~~~
main.c:3:26: note: each undeclared identifier is reported only once for each function it appears in