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

#include <string>
using namespace std;

int main(int argc, char *argv[])
{
    string map[10] = {"", ".,!? ", "abc", "def", "ghi", "jkl", "mno",
        "pqrs", "tuv", "wxyz"};
    string line;
    int n, cnt, num;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> line;
        cnt = 0;
        for (int j = 0; j < line.length(); ++j) {
            if (line[j] == '0') {
                if (j == 0 || line[j - 1] == '0')
                    continue;
                num = line[j - 1] - '0';
                cout << map[num][(cnt - 1) % map[num].length()];
                cnt = 0;
            } else if (line[j] != '0') {
                cnt++;
            }
        }
        cout << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> n;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << map[num][(cnt - 1) % map[num].length()];
      |                 ^~~~
a.cc:19:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout << endl;
      |         ^~~~
a.cc:25:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:17: error: 'endl' was not declared in this scope
   25 |         cout << endl;
      |                 ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string a,b;
	while (cin>>a){
		int la=a.size();
		int c=0;
		for(int i=0;i<la;i++){
			if(a[i]=="0"){
				if(b=="1"){
					c=c%5;
					if(c==1) cout<<".";
					if(c==2) cout<<",";
					if(c==3) cout<<"!";
					if(c==4) cout<<"?";
					if(c==0) cout<<" "; 
				}
				if(b=="2"){
					c=c%3;
					if(c==1) cout<<"a";
					if(c==2) cout<<"b";
					if(c==0) cout<<"c";
				}
				if(b=="3"){
					c=c%3;
					if(c==1) cout<<"d";
					if(c==2) cout<<"e";
					if(c==0) cout<<"f";
				}
				if(b=="4"){
					c=c%3;
					if(c==1) cout<<"g";
					if(c==2) cout<<"h";
					if(c==0) cout<<"i";
				}
				if(b=="5"){
					c=c%3;
					if(c==1) cout<<"j";
					if(c==2) cout<<"k";
					if(c==0) cout<<"l";
				}
				if(b=="6"){
					c=c%3;
					if(c==1) cout<<"m";
					if(c==2) cout<<"n";
					if(c==0) cout<<"o";
				}
				if(b=="7"){
					c=c%4;
					if(c==1) cout<<"p";
					if(c==2) cout<<"q";
					if(c==3) cout<<"r";
					if(c==0) cout<<"s";
				}
				if(b=="8"){
					c=c%3;
					if(c==1) cout<<"t";
					if(c==2) cout<<"u";
					if(c==0) cout<<"v";
				}
				if(b=="9"){
					c=c%4;
					if(c==1) cout<<"w";
					if(c==2) cout<<"x";
					if(c==3) cout<<"y";
					if(c==0) cout<<"z";
				}
				c=0;
				b="0";
			}
			else{
				b=a[i];
				c++;
			}
		}
		cout<<endl;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                         if(a[i]=="0"){
Language: C++

#include <iostream>
using namespace std;
int main(void){
    char code[][5] = {
        {0,0,0,0,0},
        {'.',',','!','?',' '},
        {97,98,99,0,0},
        {100,101,102,0,0},
        {103,104,105,0,0},
        {106,107,108,0,0},
        {109,110,111,0,0},
        {112,113,114,115,0},
        {116,117,118,0,0},
        {119,120,121,122,0}
    };
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        string input;
        cin >> input;
        int num = 0;
        int index = 0;
        for (int j = 0; j < input.length(); ++j) {
            if (str[j] == '0') {
                cout << code[num][index];
                num = 0;
                index = 0;
            } else if (!index && !num) {
                num = input[j] - '0';
            } else {
                ++index;
                while(num && !code[num][index]) {
                    if (++index == 5) index = 0;
                }
            }
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'str' was not declared in this scope; did you mean 'std'?
   24 |             if (str[j] == '0') {
      |                 ^~~
      |                 std
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	char a[9][5]={{'.',',','!','?',' '},{'a','b','c'},{'d','e','f'},{'g','h','i'},{'j','k','l'},{'m','n','o'},{'p','q','r','s'},{'t','u','v'},{'w','x','y','z'}};
	int n,c=0,d=0;
	string s;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s;d=c=0;
			for(int j=0;j<s.size();j++){
				if(s[j]=='0'&&c>0){
					if(s[j-1]=='1')d=(c-1)%5;
					else if(s[j-1]=='7'||s[j-1]=='9')d=(c-1)%4;
					else d=(c-1)%3;
					cout<<a[(int)(s[j-1]-'0')-1][d];
				c=0;
				}
				else if(s[j]=='0'&&s[j-1]=='0')continue;;
				else c++;
				}
				cout<<'\n';
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'else' without a previous 'if'
   19 |                                 else c++;
      |                                 ^~~~
Language: C++

#include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  char str[100000]={};
  char moji[10][6]={"",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
  int i;
  int n;

  cin>>n;
  rep(i,n){
    cin>>str;
    int len=strlen(str);
    int j=0;
    while(j<len){
      int num=0;
      while(str[j]!='0'){
	j++;
	num++;
      }
      if(j==0){
	j++;
	continue;
      }
      a=str[j-1]-'0';
      if(a==1)
	cout<<moji[1][(num-1)%5];
      else if((a>1 && a<7)|| a==8)
	cout<<moji[a][(num-1)%3];
      else if(a==7 || a==9)
	cout<<moji[a][(num-1)%4];
      j++;
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:7: error: 'a' was not declared in this scope
   42 |       a=str[j-1]-'0';
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
char ss[9][6]={".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
cin>>n;
while(n--&&cin>>s){
int l=s.size();
int p=-1;
for(int i=0;i<l;++i) {
if(p<0){
if(s[i]!='0') {
p=(s[i]-'1')*10;
}
}else{
if(s[i]=='0'){
cout<<ss[p/10][p%10];
p=-1;
}else{
p=(p/10*10)+(p%10+1)%strlen(ss[p/10]);
}
}
}
cout<<endl;
}??
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected primary-expression before '?' token
   26 | }??
      |  ^
a.cc:26:3: error: expected primary-expression before '?' token
   26 | }??
      |   ^
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
a.cc:26:4: error: expected ':' before '}' token
   26 | }??
      |    ^
      |    :
   27 | }
      | ~   
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
a.cc:26:4: error: expected ':' before '}' token
   26 | }??
      |    ^
      |    :
   27 | }
      | ~   
a.cc:27:1: error: expected primary-expression before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
    const char character[][] = {{},
    {'.', ',', '!', '?', ' '},
    {'a', 'b', 'c'}, 
    {'d', 'e', 'f'}, 
    {'g', 'h', 'i'}, 
    {'j', 'k', 'l'}, 
    {'m', 'n', 'o'}, 
    {'p', 'q',  'r', 's'}, 
    {'t', 'u', 'v'}, 
    {'w', 'x', 'y', 'z'}}


    int n;
    string s;
    for(int i = 0; i < n; i++){
        cin >> s;
        int index;
        for(index = i; s[index] != '0'; index++);
        int length = index - i;
        cout << character[s[i] - '0'][length / sizeof(character[s[i] - '0'] / character[s[i] - '0'][0])];
        i = index;
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: declaration of 'character' as multidimensional array must have bounds for all dimensions except the first
    5 |     const char character[][] = {{},
      |                ^~~~~~~~~
a.cc:19:24: error: 'n' was not declared in this scope
   19 |     for(int i = 0; i < n; i++){
      |                        ^
a.cc:24:17: error: 'character' was not declared in this scope
   24 |         cout << character[s[i] - '0'][length / sizeof(character[s[i] - '0'] / character[s[i] - '0'][0])];
      |                 ^~~~~~~~~
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n,temp,sum,box[]={1,5,3,3,3,3,3,4,3,4};
	char s[1030];
	char tab[10][5]={" ",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
	cin>>n;
	while(n--){
		cin>>s;
		sum=0;
		for(int i=0;i<(int)strlen(s);i++){
			if(s[i]=='0'){
				if(sum!=0){
					cout<<tab[temp][(sum-1)%box[temp]];
				}
				sum=0;
			}
			else{
				temp=s[i]-'0';
				sum++;
			}
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: initializer-string for 'char [5]' is too long [-fpermissive]
    7 |         char tab[10][5]={" ",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
      |                              ^~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){int m,i;char s[1030];char t[20][6]={" ",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};cin>>m;while(cin>>s){for(i=m=0;s[i]!='\0';i++)if(s[i]=='0'){if(m)cout<<t[s[i-1]-'0'][(m-1)%strlen(t[s[i-1]-'0'])];m=0;}else
m++;cout<<endl;}return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:202: error: 'strlen' was not declared in this scope
    3 | int main(){int m,i;char s[1030];char t[20][6]={" ",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};cin>>m;while(cin>>s){for(i=m=0;s[i]!='\0';i++)if(s[i]=='0'){if(m)cout<<t[s[i-1]-'0'][(m-1)%strlen(t[s[i-1]-'0'])];m=0;}else
      |                                                                                                                                                                                                          ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		string key[]={".,!?, ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
		string input;
		cin>>input;
		stringstream b(input);
		int num=0,count=0;
		while(){
			char c;
			if(b>>c)break;
			int input=atoi(c);
			if(input!=0){
				count++;
				num=input;
			}
			else {
				if(count!=0)
					count<<key[num-1][count%key[num-1].size()];
				num=0;count=0;
			}
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected primary-expression before ')' token
   15 |                 while(){
      |                       ^
a.cc:18:40: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   18 |                         int input=atoi(c);
      |                                        ^
      |                                        |
      |                                        char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
using namespace std;
int main(){
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		string key[]={".,!?, ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
		string input;
		cin>>input;
		stringstream b(input);
		int num=0,count=0;
		while(1){
			char c;
			if(b>>c)break;
			int input=atoi(c);
			if(input!=0){
				count++;
				num=input;
			}
			else {
				if(count!=0)
					count<<key[num-1][count%key[num-1].size()];
				num=0;count=0;
			}
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   18 |                         int input=atoi(c);
      |                                        ^
      |                                        |
      |                                        char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

char const mozi1[]={'.',',','!','?',' '},mozi2[]={'a','b','c'},mozi3[]={'d','e','f'},mozi4[]={'g','h','i'},mozi5[]={'j','k','l'},mozi6[]={'m','n','o'},mozi7[]={'p','q','r','s'},mozi8[]={'t','u','v'},mozi9[]={'w','x','y','z'};
void henkan(char *);
char mozi(int,char);
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		char * keitai=new char[1024];
		scanf("%s",keitai);
		henkan(keitai);
		delete[]keitai;
	}
	return 0;
}

void henkan(char * keitai){
	char *hyouzi=new char[72];
	fill(hyouzi,hyouzi+72,0);
	int length=strlen(keitai);
	int cnt=0;
	
	for(int i=0;i<length;i++){
		if(keitai[i]=='0')	continue;
		else{
			int kazu=1;
			while(keitai[i+1]!='0'){
				kazu++;
				i++;
			}
			hyouzi[cnt]=mozi(kazu,keitai[i]);
			i++;
			cnt++;
		}
	}
	
	cout<<hyouzi<<endl;
	delete[] hyouzi;
}
char mozi(int kazu,char keitai){
	switch (keitai)
	{
	case '1':
		kazu=kazu%5-1;
		if(kazu==-1)	return mozi1[4];
		return mozi1[kazu];
		
	case '2':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi2[2];
		return mozi2[kazu];
		
	case '3':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi3[2];
		return mozi3[kazu];
		
	case '4':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi4[2];
		return mozi4[kazu];
		
	case '5':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi5[2];
		return mozi5[kazu];
		
	case '6':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi6[2];
		return mozi6[kazu];
		
	case '7':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi7[3];
		return mozi7[kazu];
		
	case '8':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi8[2];
		return mozi8[kazu];
		
	case '9':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi9[3];
		return mozi9[kazu];
	default:
		return NULL;
	}
}

Compiler output:
a.cc: In function 'void henkan(char*)':
a.cc:26:20: error: 'strlen' was not declared in this scope
   26 |         int length=strlen(keitai);
      |                    ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc: In function 'char mozi(int, char)':
a.cc:94:24: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   94 |                 return NULL;
      |                        ^~~~
Language: C++

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

char const mozi1[]={'.',',','!','?',' '},mozi2[]={'a','b','c'},mozi3[]={'d','e','f'},mozi4[]={'g','h','i'},mozi5[]={'j','k','l'},mozi6[]={'m','n','o'},mozi7[]={'p','q','r','s'},mozi8[]={'t','u','v'},mozi9[]={'w','x','y','z'};
void henkan(char *);
char mozi(int,char);
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		char * keitai=new char[1024];
		scanf("%s",keitai);
		henkan(keitai);
		delete[]keitai;
	}
	return 0;
}

void henkan(char * keitai){
	char *hyouzi=new char[72];
	fill(hyouzi,hyouzi+72,0);
	int length=strlen(keitai);
	int cnt=0;
	
	for(int i=0;i<length;i++){
		if(keitai[i]=='0')	continue;
		else{
			int kazu=1;
			while(keitai[i+1]!='0'){
				kazu++;
				i++;
			}
			hyouzi[cnt]=mozi(kazu,keitai[i]);
			i++;
			cnt++;
		}
	}
	
	cout<<hyouzi<<endl;
	delete[] hyouzi;
        return;
}
char mozi(int kazu,char keitai){
	switch (keitai)
	{
	case '1':
		kazu=kazu%5-1;
		if(kazu==-1)	return mozi1[4];
		return mozi1[kazu];
		
	case '2':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi2[2];
		return mozi2[kazu];
		
	case '3':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi3[2];
		return mozi3[kazu];
		
	case '4':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi4[2];
		return mozi4[kazu];
		
	case '5':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi5[2];
		return mozi5[kazu];
		
	case '6':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi6[2];
		return mozi6[kazu];
		
	case '7':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi7[3];
		return mozi7[kazu];
		
	case '8':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi8[2];
		return mozi8[kazu];
		
	case '9':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi9[3];
		return mozi9[kazu];
	default:
		return NULL;
	}
}

Compiler output:
a.cc: In function 'void henkan(char*)':
a.cc:26:20: error: 'strlen' was not declared in this scope
   26 |         int length=strlen(keitai);
      |                    ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc: In function 'char mozi(int, char)':
a.cc:95:24: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   95 |                 return NULL;
      |                        ^~~~
Language: C++

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

char const mozi1[]={'.',',','!','?',' '},mozi2[]={'a','b','c'},mozi3[]={'d','e','f'},mozi4[]={'g','h','i'},mozi5[]={'j','k','l'},mozi6[]={'m','n','o'},mozi7[]={'p','q','r','s'},mozi8[]={'t','u','v'},mozi9[]={'w','x','y','z'};
void henkan(char *);
char mozi(int,char);
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		char * keitai=new char[1024];
		scanf("%s",keitai);
		henkan(keitai);
		delete[]keitai;
	}
	return 0;
}

void henkan(char * keitai){
	char *hyouzi=new char[72];
	fill(hyouzi,hyouzi+72,0);
	int length=strlen(keitai);
	int cnt=0;
	
	for(int i=0;i<length;i++){
		if(keitai[i]=='0')	continue;
		else{
			int kazu=1;
			while(keitai[i+1]!='0'){
				kazu++;
				i++;
			}
			hyouzi[cnt]=mozi(kazu,keitai[i]);
			i++;
			cnt++;
		}
	}
	
	cout<<hyouzi<<endl;
	delete[] hyouzi;
	return;
}
char mozi(int kazu,char keitai){
	switch (keitai)
	{
	case '1':
		kazu=kazu%5-1;
		if(kazu==-1)	return mozi1[4];
		return mozi1[kazu];
		
	case '2':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi2[2];
		return mozi2[kazu];
		
	case '3':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi3[2];
		return mozi3[kazu];
		
	case '4':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi4[2];
		return mozi4[kazu];
		
	case '5':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi5[2];
		return mozi5[kazu];
		
	case '6':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi6[2];
		return mozi6[kazu];
		
	case '7':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi7[3];
		return mozi7[kazu];
		
	case '8':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi8[2];
		return mozi8[kazu];
		
	case '9':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi9[3];
		return mozi9[kazu];
	default:
		return '0';
	}
}

Compiler output:
a.cc: In function 'void henkan(char*)':
a.cc:26:20: error: 'strlen' was not declared in this scope
   26 |         int length=strlen(keitai);
      |                    ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

char const mozi1[]={'.',',','!','?',' '},mozi2[]={'a','b','c'},mozi3[]={'d','e','f'},mozi4[]={'g','h','i'},mozi5[]={'j','k','l'},mozi6[]={'m','n','o'},mozi7[]={'p','q','r','s'},mozi8[]={'t','u','v'},mozi9[]={'w','x','y','z'};
void henkan(char *);
char mozi(int,char);
int main(){
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		char * keitai=new char[1024];
		cin>>keitai;
		henkan(keitai);
		delete[]keitai;
	}
	return 0;
}

void henkan(char * keitai){
	char *hyouzi=new char[72];
	fill(hyouzi,hyouzi+72,NULL);
	int length=strlen(keitai);
	int cnt=0;
	
	for(int i=0;i<length;i++){
		if(keitai[i]=='0')	continue;
		else{
			int kazu=1;
			while(keitai[i+1]!='0'){
				kazu++;
				i++;
			}
			hyouzi[cnt]=mozi(kazu,keitai[i]);
			i++;
			cnt++;
		}
	}
	
	cout<<hyouzi<<endl;
	delete[] hyouzi;
	return;
}
char mozi(int kazu,char keitai){
	switch (keitai)
	{
	case '1':
		kazu=kazu%5-1;
		if(kazu==-1)	return mozi1[4];
		return mozi1[kazu];
		
	case '2':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi2[2];
		return mozi2[kazu];
		
	case '3':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi3[2];
		return mozi3[kazu];
		
	case '4':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi4[2];
		return mozi4[kazu];
		
	case '5':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi5[2];
		return mozi5[kazu];
		
	case '6':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi6[2];
		return mozi6[kazu];
		
	case '7':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi7[3];
		return mozi7[kazu];
		
	case '8':
		kazu=kazu%3-1;
		if(kazu==-1)	return mozi8[2];
		return mozi8[kazu];
		
	case '9':
		kazu=kazu%4-1;
		if(kazu==-1)	return mozi9[3];
		return mozi9[kazu];
	default:
		return '0';
	}
}

Compiler output:
a.cc: In function 'void henkan(char*)':
a.cc:25:20: error: 'strlen' was not declared in this scope
   25 |         int length=strlen(keitai);
      |                    ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | #include<string>
Language: C++

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

int main()
{
	int n, p, cnt;
	string key[] = {"", ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
	string str;
	
	cin >> n;
	while (cin >> str) {
		for (char& c : str) {
			n = c - '0';
			if (n) {
				cnt++;
			} else {
				cout << key[p][(cnt-1) % key[n].size]
				cnt = 0;
			}
			p = n;
		}
		cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:65: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   18 |                                 cout << key[p][(cnt-1) % key[n].size]
      |                                                          ~~~~~~~^~~~
      |                                                                     ()
Language: C++

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

int main()
{
	int n, p, cnt;
	string key[] = {"", ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
	string str;
	
	cin >> n;
	while (cin >> str) {
		for (char& c : str) {
			n = c - '0';
			if (n) {
				cnt++;
			} else {
				cout << key[p][(cnt-1) % key[n].size];
				cnt = 0;
			}
			p = n;
		}
		cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:65: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   18 |                                 cout << key[p][(cnt-1) % key[n].size];
      |                                                          ~~~~~~~^~~~
      |                                                                     ()
Language: Java

import java.util.Scanner;

//Make Purse Light
public class AOJ2007 {

	public static int minCoin;
	public static int[] coins;
	public static int[] used;
	public static int[] ans;

	public static int returnCoin(int x){
		int s = 0;
		s += x/500;
		x %= 500;
		s += x/100;
		x %= 100;
		s += x/50;
		x %= 50;
		s += x/10;
		return s;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		boolean first = true;
		while(true){
			int x = sc.nextInt();
			if(x==0)break;
			if(!first)System.out.println();
			first = false;
			minCoin = Integer.MAX_VALUE;
			coins = new int[4];
			int num = 0;
			for(int i=0;i<4;i++){
				coins[i] = sc.nextInt();
				num += coins[i];
			}
			used = new int[4];
			ans = new int[4];
			for(used[0]=0;used[0]<=coins[0];used[0]++){
				for(used[1]=0;used[1]<=coins[1];used[1]++){
					for(used[2]=0;used[2]<=coins[2];used[2]++){
						for(used[3]=0;used[3]<=coins[3];used[3]++){
							int sum = used[0]*10 + used[1]*50 + used[2]*100 + used[3]*500;
							if(sum >= x && num-(used[0]+used[1]+used[2]+used[3])+returnCoin(sum-x)<minCoin){
								minCoin = num-(used[0]+used[1]+used[2]+used[3])+returnCoin(sum-x);
								for(int i=0;i<4;i++)ans[i]=used[i];
							}
						}
					}
				}
			}
			for(int i=0;i<4;i++){
				if(ans[i]!=0){
					System.out.println((i==0?10:i==1?50:i==2?100:500) + " " + ans[i]);
				}
			}
		}
	}
}

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

#include <stdio.h>

int c10, c50, c100, c500;
int a10, a50, a100, a500;
int b_mon;
int a_mon;
int price;

int main(void) 
{
	scanf("%d",&price);

	while (price) {
		scanf("%d %d %d %d", &c10, &c50, &c100, &c500);
		b_mon = c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;
		a_mon = b_mon - price;

		a500 = a_mon / 500;
		a_mon %= 500;
		a100 = a_mon / 100;
		a_mon %= 100;
		a50 = a_mon / 50;
		a_mon %= 50;
		a10 = a_mon / 10;
		a_mon %= 10;

		if (a10 < c10) {
			print("10 %d\n",c10 - a10);
		}
		if (a50 < c50) {
			print("50 %d\n",c50 - a50);
		}
		if (a100 < c100) {
			print("100 %d\n",c100 - a100);
		}
		if (a500 < c500) {
			print("500 %d\n",c500 - a500);
		}
		scanf("%d",&price);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:25: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   28 |                         print("10 %d\n",c10 - a10);
      |                         ^~~~~
      |                         printf
Language: C

v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
	for(N=0;scanf("%d",&c),c;N++)){
		if(N)puts("");
		scanf("%d%d%d%d",a,a+1,a+2,a+3);
		for(m=i=0;i<4;i++)m+=a[i]*v[i];
		m-=c;
		r[3]=m/500,r[2]=m%500/100,r[1]=m%100/50,r[0]=m%50/10;
		for(i=0;i<4;i++)if((a[i]-=r[i])>0)printf("%d %d\n",v[i],a[i]);
	}
	return 0;
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'v' [-Wimplicit-int]
main.c:1:22: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
      |                      ^
main.c:1:27: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
    1 | v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
      |                           ^
main.c:1:32: error: return type defaults to 'int' [-Wimplicit-int]
    1 | v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
      |                                ^~~~
main.c: In function 'main':
main.c:1:32: error: type of 'N' defaults to 'int' [-Wimplicit-int]
main.c:1:32: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:32: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:1:32: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 |         for(N=0;scanf("%d",&c),c;N++)){
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | v[4]={10,50,100,500},a[4],r[4];main(N,c,m,i){
main.c:2:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 |         for(N=0;scanf("%d",&c),c;N++)){
      |                 ^~~~~
main.c:2:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:38: error: expected statement before ')' token
    2 |         for(N=0;scanf("%d",&c),c;N++)){
      |                                      ^
main.c:3:22: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    3 |                 if(N)puts("");
      |                      ^~~~
main.c:3:22: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:4:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |                 scanf("%d%d%d%d",a,a+1,a+2,a+3);
      |                 ^~~~~
main.c:4:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:51: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |                 for(i=0;i<4;i++)if((a[i]-=r[i])>0)printf("%d %d\n",v[i],a[i]);
      |                                                   ^~~~~~
main.c:8:51: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:51: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:51: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

using namespace std;

inline int calc(int a,int b,int c,int d){
    return a*10+b*50+c*100+d*500;
}

int val(int arg, int &x1, int &x2, int &x3 , int &x4){
    int ret = 0, tmp;
    tmp = arg / 500;
    ret += tmp;
    x1 = tmp;
    arg -= tmp * 500;
    tmp = arg / 100;
    ret += tmp;
    x2 = tmp;
    arg -= tmp * 100;
    tmp = arg / 50;
    ret += tmp;
    x3 = tmp;
    arg -= tmp * 50;
    tmp = arg / 10;
    ret += tmp;
    x4 = tmp;
    return ret;
}

struct pay{
    int p,q,r,s,v,sum;

    pay(int vv, int pp, int qq, int rr, int ss, int xx){
        v = vv;
        p = pp;
        q = qq;
        r = rr;
        s = ss;
        sum = xx;
    }
};

int main(){
    int n;
    bool f = true;
    while(cin >> n && n){
        if(f){
            f = false;
        }else{
            cout << endl;
        }
        int a,b,c,d,y1=0,y2=0,y3=0,y4=0,x[4];
        vector<pay> v;
        int ret = 1 << 20;
        int ret2 = 1 << 20;
        cin >> a >> b >> c >> d;
        

        for(int p=0;p<=a;p++){
            for(int q=0;q<=b;q++){
                for(int r=0;r<=c;r++){
                    for(int s=0;s<=d;s++){
                        v.push_back(pay(calc(p,q,r,s), p,q,r,s,p+q+r+s));
                    }
                }
            }
        }
    
        for(int i=0;i<v.size();i++){
            if(v[i].v >= n){
                int tmpv = val(v[i].v-n,x[0],x[1],x[2],x[3]) + v[i].sum - (v[i].p + v[i].q + v[i].r + v[i].s);
                int tmpv2 = v[i].v;
                if(ret > tmpv || (ret == tmpv && ret2 > tmpv2)){
                    ret = tmpv;
                    ret2 = tmpv2;
                    y1 = v[i].p;
                    y2 = v[i].q;
                    y3 = v[i].r;
                    y4 = v[i].s;
                }
            }
        }
        if(y1){
            cout << "10 " << y1 << endl;
        }
        if(y2){
            cout << "50 " << y2 << endl;
        }
        if(y3){
            cout << "100 " << y3 << endl;
        }
        if(y4){
            cout << "500 " << y4 << endl;
        }
    }
}

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

#include<stdio.h>
#include<alg.h>
#define m(a,b) (a<b?a:b)
int n[5],i,I,v[5]={0,10,50,100,500},t,u[5];
int main()
{
	for(;scanf("%d",&n[I++%5]),n[0];)
	if(I%5==0)
	{
		
		for(i=1,t=-n[0];i<5;t+=n[i]*v[i],i++);
		for(i=5;--i;u[i]=t/v[i],t-=v[i]*u[i]);
		for(i=1;i<5;i++)
			n[i]>u[i]?printf("%d %d\n",v[i],n[i]-u[i]):0;
		puts("");
	}
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int t;
int coin[4]={10,50,100,500};
int num[4];
int res[4];

int cmin=inf;
int index[4];

void dfs(int i,int* index){
	if(i==4){
		int sum=0;
		rep(j,4) sum+=coin[j]*index[j];
		if(sum<t)
			return;
		sum-=t;
		int ch[4];
		rep(j,4){
			ch[3-j]=sum/coin[3-j];
			sum-=(sum/coin[3-j]*coin[3-j]);
		}
		int cur=0;
		rep(j,4) cur+=(num[j]-index[j]+ch[j]);
		if(cur<cmin){
			cmin=cur;
			rep(j,4) res[j]=index[j];
		}
		return;
	}
	for(index[i]=0;index[i]<=num[i];++index[i]){
		dfs(i+1,index);
	}
	return ;
}

int main(void){
	bool first=true;
	while(cin >> t){
		if(t==0)
			break;
		if(first)
			first=false;
		else
			cout << endl;
		cmin=inf;
		rep(i,4) cin >> num[i];
		dfs(0,index);
		rep(i,4)if(res[i]!=0)
			cout << coin[i] <<" " << res[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc:38:12: error: 'int index [4]' redeclared as different kind of entity
   38 | int index[4];
      |            ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:77:20: error: cannot resolve overloaded function 'index' based on conversion to type 'int*'
   77 |                 dfs(0,index);
      |                 ~~~^~~~~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int otsuri();

int shiharai, daikin, otsuri_mai;
int money[4] = {10, 50, 100, 500};

int main()
{
	while(1){
		cin >> daikin;
		if(daikin == 0) break;
		int sum_money = 0, sum_had_mai = 0;
		int had_mai[4], use_mai[4];
		for(int i = 0; i < 4; i++){
			cin >> had_mai[i];
			sum_money = money[i] * had_mai[i];
			sum_had_mai += had_mai[i];
		}
		int sum_have_mai, min_have_mai = 100;
		for(int i = 0; i <= had_mai[3]; i++){
			if(daikin <= 500 * (i - 1)) break;
			for(int j = 0; j <= had_mai[2]; j++){
				for(int k = 0; k <= had_mai[1]; k++){
					for(int l = 0; l <= had_mai[0]; l++){
						shiharai = 500 * i + 100 * j + 50 * k + 10 * l;
						if(shiharai >= daikin) {
							sum_have_mai = sum_had_mai;
							sum_have_mai -= i + j + k + l;
							otsuri_mai = otsuri();
							sum_have_mai += otsuri_mai;
							if(sum_have_mai < min_have_mai){
								min_have_mai = sum_have_mai;
								use_mai[3] = i;
								use_mai[2] = j;
								use_mai[1] = k;
								use_mai[0] = l;
							}
						}
					}
				}
			}
		}
		for(int i = 0; i < 4; i++){
			if(use_mai[i] != 0) cout << money[i] << '' << use_mai[i] << endl;
		}
		cout << endl;
	} 
	return 0;
}

int otsuri()
{
	int tsuri = shiharai - daikin;
	int cnt = 0;
	int mai = 0;
	for(int i = 3; i >= 0; i--){
		mai = tsuri / money[i];
		tsuri -= money[i] * mai;
		cnt += mai;
	}
	return cnt;
}

Compiler output:
a.cc:59:65: error: empty character constant
   59 |                         if(use_mai[i] != 0) cout << money[i] << '' << use_mai[i] << endl;
      |                                                                 ^~
Language: C++

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

int coin(int s){
return s/500 + (s%500)/100 + (s%100)/50 + (s%50)/10;
}

int main(){
bool flag = false;

int n; 
while(1){
int a, b, c, d;
cin >> n;
if(n == 0) break;
if(flag) cout << endl;
else flag = true;
cin >> a >> b >> c >> d;
int ans = INT_MAX;
int x, y, z, w;
for(int i = 0; i <= a; i++){
for(int j = 0; j <= b; j++){
for(int t = 0; t <= c; t++){
for(int s = 0; s <= d; s++){
int rem = coin(n-i*10-j*50-t*100-s*500);
rem += a-i+b-j+c-t+d-s;
if(ans > rem){
ans = rem;
x = i;
y = j;
z = t;
w = s;
}
}
}
}
if(x) cout << 10 << " " << x << endl;
if(y) cout << 50 << " " << y << endl;
if(z) cout << 100 << " " << z << endl;
if(w) cout << 500 << " " << w << endl;
}

}

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

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

vector<int> ret(int v,int n){
  n-=v;
  vector<int> r(4);
  r[3]=n/500; n%=500;
  r[2]=n/100; n%=100;
  r[1]=n/50; n%=50;
  r[0]=n/10;
  return r;
}
int main(){
  int n;
  int t[] = {10,50,100,500};
  int t = 0;
  while(cin>>n,n){
    vector<int> c(4);
    for(int i=0;i<4;++i) cin >> c[i];
    int s = c[0]*10+c[1]*50+c[2]*100+c[3]*500;
    vector<int> r = ret(n,s);
    if(t) cout << endl;
    for(int i=0;i<4;++i){
      if(c[i]-r[i]>0) cout << t[i] << " " << c[i]-r[i] << endl;
    }
    ++t;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: conflicting declaration 'int t'
   17 |   int t = 0;
      |       ^
a.cc:16:7: note: previous declaration as 'int t [4]'
   16 |   int t[] = {10,50,100,500};
      |       ^
a.cc:27:7: error: lvalue required as increment operand
   27 |     ++t;
      |       ^
Language: C++

#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)

using namespace std;

int reverse_coin(int c){
    int cnt=0;
    while(1){
        if(c == 0){
            break;
        }
        if(500 <= c){
            c-=500;
            cnt++;
        }else if(100 <= c){
            c-=100;
            cnt++;
        }else if(50 <= c){
            c-=50;
            cnt++;
        }else if(10 <= c){
            c-=10;
            cnt++;
        }
    }
    return cnt;
}
int main(){
    int n,ju,goju,hya,gohya;
    while(cin >> n&&n){
        int a=0,b=0,c=0,d=0,e=0;
        int max=10000;
        cin >> a >> b >> c >> d;
        e=a+b+c+d;
        for(int i=0;i<=a;i++){
            for(int j=0;j<=b;j++){
                for(int k=0;k<=c;k++){
                    for(int l=0;l<=d;l++){
                        if(n <= i*10+j*50+k*100+l*500){
                            int c = i*10+j*50+k*100+l*500 - n;
                            if(max > e+reverse_coin(c)-i-j-k-l){
                                max = e+reverse_coin(c)-i-j-k-l;
                                ju = i;
                                goju = j;
                                hya = k;
                                gohya = l;
                            }
                        }
                    }
                }
            }
        }
        if(ju > 0){
            cout << "10 " << ju << endl;
        }
        if(goju > 0){
            cout << "50 " goju << endl;
        }
        if(hya > 0){
            cout << "100 " << hya << endl;
        }
        if(gohya > 0){
            cout << "500 " << gohya << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:26: error: expected ';' before 'goju'
   81 |             cout << "50 " goju << endl;
      |                          ^~~~~
      |                          ;
Language: C++

#include<iostream>using namespace std;int main(){int n,f=0;while(1){int m[501]={};cin>>n;if(n==0) break;cin>>m[10]>>m[50]>>m[100]>>m[500];if(f==1) cout<<endl;n=m[500]*500+m[100]*100+m[50]*50+m[10]*10-n;m[500]-=n/500,n%=500,m[100]-=n/100,n%=100,m[50]-=n/50,n%=50,m[10]-=n/10;for(int i=10;i<=500;i+=10) if(m[i]>0) cout<<i<<" "<<m[i]<<endl;f=1;}return 0;}

Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<iostream>using namespace std;int main(){int n,f=0;while(1){int m[501]={};cin>>n;if(n==0) break;cin>>m[10]>>m[50]>>m[100]>>m[500];if(f==1) cout<<endl;n=m[500]*500+m[100]*100+m[50]*50+m[10]*10-n;m[500]-=n/500,n%=500,m[100]-=n/100,n%=100,m[50]-=n/50,n%=50,m[10]-=n/10;for(int i=10;i<=500;i+=10) if(m[i]>0) cout<<i<<" "<<m[i]<<endl;f=1;}return 0;}
      |                         ^~~~~~~~~
a.cc:1:9: fatal error: iostream>usin: No such file or directory
    1 | #include<iostream>using namespace std;int main(){int n,f=0;while(1){int m[501]={};cin>>n;if(n==0) break;cin>>m[10]>>m[50]>>m[100]>>m[500];if(f==1) cout<<endl;n=m[500]*500+m[100]*100+m[50]*50+m[10]*10-n;m[500]-=n/500,n%=500,m[100]-=n/100,n%=100,m[50]-=n/50,n%=50,m[10]-=n/10;for(int i=10;i<=500;i+=10) if(m[i]>0) cout<<i<<" "<<m[i]<<endl;f=1;}return 0;}
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m[4],p[4]={10,50,100,500},x[4],y[4],k,i=0,q,j;
	while(true){
		cin>>n;if(!n){break;}
		if(i){
			cout<<endl;
		}
		i++;
		k=0;
		cin>>m[0]>>m[1]>>m[2]>>m[3];
		for(j=3;j>=0;j--){
			k+=m[j]*p[j];
		}
		q=k-n;
		for(int j=3;j>=0;j--){
			x[j]=q/p[j];
			q-=x[j]*p[j];
			y[j]=max(0,m[j]-x[j]);
		}
		for(int j=0;j<4;j++){
			if(y[j]){printf("%d %d\n",p[j],y[j])}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:61: error: expected ';' before '}' token
   23 |                         if(y[j]){printf("%d %d\n",p[j],y[j])}
      |                                                             ^
      |                                                             ;
Language: C++

#include<bits/stdc++.h>
main(){
int n,m[4],p[4]={10,50,100,500},x[4],y[4],k,i=0,q,j;
while(true){
std::cin>>n;if(!n){break;}
if(i){cout<<endl;}i++;k=0;
std::cin>>m[0]>>m[1]>>m[2]>>m[3];
for(j=3;j>=0;j--){k+=m[j]*p[j];}
q=k-n;
for(j=3;j>=0;j--){x[j]=q/p[j];q-=x[j]*p[j];y[j]=std::max(0,m[j]-x[j]);}
for(j=0;j<4;j++){if(y[j]){printf("%d %d\n",p[j],y[j]);}}
}}

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:6:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | if(i){cout<<endl;}i++;k=0;
      |       ^~~~
      |       std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 | if(i){cout<<endl;}i++;k=0;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include "bits/stdc++.h"
#pragma warning(disable:4996)
using namespace std;

int coins[4] = { 10,50,100,500 };

int  getans(const int money, const vector<int>&nums) {
	int turi = -money;
	for (int i = 0; i < 4; ++i) {
		turi += coins[i] * nums[i];
	}
	if (turi < 0)return 99999999;

	vector<int>turicoins(4);
	for (int i = 3; i >= 0; --i) {
		turicoins[i] = turi / coins[i];
		turi -= turicoins[i] * coins[i];
	}
	for (int i = 0; i < 4; ++i) {
		if (turicoins[i] && nums[i])return 99999999;
	}

	return accumulate(turicoins.begin(), turicoins.end(), 0);
}

int main() {
	bool a = false;
	while (1) {
		if (!N)break;
		if (a) {

			cout << endl;
		}
		a = true;
		int N; cin >> N;

		vector<int>nums;
		int sum = 0;
		for (int i = 0; i < 4; ++i) {
			int a; cin >> a;
			sum += a;
			nums.push_back(a);
		}

		int minans = 99999999;
		vector<int>ans;
		for (int i = 0; i <= nums[0]; ++i) {
			for (int j = 0; j <= nums[1]; ++j) {
				for (int k = 0; k <= nums[2]; ++k) {
					for (int l = 0; l <= nums[3]; ++l) {
						vector<int>nums(4);
						nums[0] = i; nums[1] = j; nums[2] = k; nums[3] = l;
						int nans = sum - i - j - k - l + getans(N, nums);
						if (nans < minans) {
							minans = nans;
							ans = nums;
						}
					}
				}
			}
		}
		for (int i = 0; i < 4; ++i) {
			if (ans[i]) {
				cout << to_string(coins[i])<<" " << ans[i] << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: 'N' was not declared in this scope
   29 |                 if (!N)break;
      |                      ^
Language: C++

#include <bits/stdc++.h>

#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;

int main()
{
    int a;
    while (cin >> a, a) {
        int b[4], ans[4];
        int kind[4] = {10, 50, 100, 500};
        cin >> b[0] >> b[1] >> b[2] >> b[3];
        bool f = false;

        int total = 0;
        loop(4, i) total += b[i] * kind[i];
        INSP(total)
        int otsuri = total - a;
        for (int i = 3; i >= 0; i--) {
            int tmp = oturi / kind[i];
            ans[i] = b[i] - tmp;
            oturi -= tmp * kind[i];
        }

        loop(4, i) if(ans[i] > 0) cout << kind[i] << ' ' << ans[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'oturi' was not declared in this scope; did you mean 'otsuri'?
   25 |             int tmp = oturi / kind[i];
      |                       ^~~~~
      |                       otsuri