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

#include<bits/stdc++.h>
using namespace std;
 
int N,S;
int dfs(int n,int t,int sum){
if(n==10)return 0;if(t==N){if(sum==S)return 1;else return 0;}
    return dfs(n+1,t,sum)+dfs(n+1,t+1,sum+n);
}
int main(){
    while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: 'n' was not declared in this scope
   10 |     while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl;
      |                     ^
a.cc:10:24: error: 's' was not declared in this scope
   10 |     while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl;
      |                        ^
Language: C++

#include<iostream>
using namespace std;


dfs(int a,int b,int c){//a????????£???b????????????????????¨c
//c?????????
	if(b < 0)
		return 0;
	if(c < 0)
		return 0;
	if(a < 0)
		return 0;
	int n=0;
	if(b == 0 && a == 1){
		n++;
	}
	n =n + dfs(a-1,b-c,c-1) + dfs(a,b,c-1);
	return n;
}

int main(){
	int n,s;
	for(;;){
	cin >> n >> s;
	if(n==0&&s==0)
		break;
	cout << dfs(n,s,9) << endl;
	}
	return 0;
}

Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
    5 | dfs(int a,int b,int c){//a????????£???b????????????????????¨c
      | ^~~
Language: C++

 
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int a[10]={0,1,2,3,4,5,6,7,8,9};
 int n,s;
 int count_2;
 
 void dfs(int step,int i,int sum)
 {
   if(sum>s||step>n) return;
   if(step==n&&i==10&&sum==s)
   {
     count_2++;
     return;                          
   }     
   dfs(step,i+1,sum) 
   dfs(step+1,i+1,sum+a[i])
   return;
 }
  
 int main()
 {
   while(cin>>n>>s)
   {
     if(n==0&&s==0) break;
     else
     {
       count_2=0;
       dfs(0,0,0);    
     } 
     cout<<count_2<<endl;               
   }
   //while(1);     
   return 0;  
 }
 

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:31:21: error: expected ';' before 'dfs'
   31 |    dfs(step,i+1,sum)
      |                     ^
      |                     ;
   32 |    dfs(step+1,i+1,sum+a[i])
      |    ~~~
Language: C++

#include<iostream>

using namespace std;

int ans = 0;
void dfs(int n,int s,int depth){
	//if (s < 0) return;  //
	if (s == 0 and n == 0){ // ?§£??????????????£??????
		ans++;
		return;
	}
	if (n == 0) return;	

	d++;
	if (depth == 10)return;
	//???????????´???
	dfs(n-1,s-depth,depth);
	//?????°????????£?????´???
	dfs(n,s,depth);
return;
}

int main(){
	while(1){
		ans = 0;
		int n,s; cin >> n >> s;
		if (n + s == 0)	break;
		dfs(n,s,-1);
		cout << ans << endl;
	}

return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:14:9: error: 'd' was not declared in this scope
   14 |         d++;
      |         ^
Language: C++

#include <stdio.h>
 
int i,n,s;
 
int part(int cal, int index, int sum){
			if(index == 9 && cal == n && sum == s){
			i++;
			return;	
			} 
			
			if(index > 9|| cal > n||sum > s) return;
			
	part(cal, index + 1, sum);
	part(cal + 1, index + 1, sum + index);
}
 
main(){
	scanf("%d %d" , &n , &s);
	if (n==0 && s==0) return 0;
	part(0, 0, 0);
	printf("%d",i);
	return 0;
}

Compiler output:
a.cc: In function 'int part(int, int, int)':
a.cc:8:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
    8 |                         return;
      |                         ^~~~~~
a.cc:11:58: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |                         if(index > 9|| cal > n||sum > s) return;
      |                                                          ^~~~~~
a.cc: At global scope:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main(){
      | ^~~~
a.cc: In function 'int part(int, int, int)':
a.cc:14:13: warning: control reaches end of non-void function [-Wreturn-type]
   14 |         part(cal + 1, index + 1, sum + index);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int func(int n, int s, int i){
	if(!n){
    	if(!s)return 1;
    	else return 0;
    }
	if(i >= 10 || s-i < 0)return 0;
	return test(n, s, i+1) + test(n-1, s-i, i+1);
}

int main(){
	int n, s;
	while(cin >> n >> s && (n || s)){
		cout << func() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int func(int, int, int)':
a.cc:10:16: error: 'test' was not declared in this scope
   10 |         return test(n, s, i+1) + test(n-1, s-i, i+1);
      |                ^~~~
a.cc: In function 'int main()':
a.cc:16:29: error: too few arguments to function 'int func(int, int, int)'
   16 |                 cout << func() << endl;
      |                         ~~~~^~
a.cc:4:5: note: declared here
    4 | int func(int n, int s, int i){
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int func(int n, int s, int i){
	if(!n){
    	if(!s)return 1;
    	else return 0;
    }
	if(i >= 10 || s-i < 0)return 0;
	return test(n, s, i+1) + test(n-1, s-i, i+1);
}

int main(){
	int n, s;
	while(cin >> n >> s && (n || s)){
		cout << func(n, s, 0) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int func(int, int, int)':
a.cc:10:16: error: 'test' was not declared in this scope
   10 |         return test(n, s, i+1) + test(n-1, s-i, i+1);
      |                ^~~~
Language: C++

#include<stdio.h>
int main(void){
   int n, a, b, c, d, sum, key;
   while(scanf("%d s", &n, &s) != EOF){
      key = 0;
      fir(i = 0; )
      for(a = 0; a <= 9; a++){
         for(b = 1; b <= 9; b++){
            for(c = 2; c <= 9; c++){
               for(d = 3; d <= 9; d++){
                  for(e = 4; e <= 9; e++){
                     for(f = 5; f <= 9; f++){
                        for(g = 6; g <= 9; g++){
                           for(h = 7; h <= 9; h++){
                              for(i = 9; i <= 9; i++){
                                 j = 9;
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      printf("%d\n", key);
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:29: error: 's' was not declared in this scope
    4 |    while(scanf("%d s", &n, &s) != EOF){
      |                             ^
a.cc:6:11: error: 'i' was not declared in this scope
    6 |       fir(i = 0; )
      |           ^
a.cc:6:18: error: expected primary-expression before ')' token
    6 |       fir(i = 0; )
      |                  ^
a.cc:7:29: error: expected ';' before ')' token
    7 |       for(a = 0; a <= 9; a++){
      |                             ^
      |                             ;
Language: C++

#include <iostream>
#include <stack>

using namespace std;

struct set { int i, sum, depth; };

int n, s, cnt;
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

void dfs(int i, int sum, int depth) {
    stack<set> S;
    S.push(set{next, sum, depth});

    while (!S.empty()) {
        set u = S.top();
        if (u.depth == n && u.sum == s) { cnt++; }

        if (u.i == 10 && u.depth == 0 && u.sum == 0) { break; }

        if (u.next < 10 && u.depth < n) {
            S.push(set{u.i + 1, u.sum, u.depth});
            S.push(set{u.i + 1, u.sum + a[u.i], u.depth + 1});
        }
        else if (u.next == 10) {
            int tmp = u.depth;
            while (S.top().depth == tmp) { S.pop(); }
        }
        else { S.pop(); }
    }
}

int main() {
    while (cin >> n >> s) {
        if (!n && !s) { break; }
        cnt = 0;
        dfs(0, 0, 0);
        cout << cnt << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:13:32: error: cannot resolve overloaded function 'next' based on conversion to type 'int'
   13 |     S.push(set{next, sum, depth});
      |                                ^
a.cc:21:15: error: 'struct set' has no member named 'next'
   21 |         if (u.next < 10 && u.depth < n) {
      |               ^~~~
a.cc:25:20: error: 'struct set' has no member named 'next'
   25 |         else if (u.next == 10) {
      |                    ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    int n, s, cnt, sum;
    int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

    while (true) {
        cin >> n >> s;
        if (!n && !s) break;

        int arr[10] = {0};
        for (int i = 0; i < n; i++) { arr[9-i] = 1 };
        cnt = 0;
        do {
            sum = 0;
            for (int i = 0; i < 10; i++) {
                if(arr[i]) { sum += a[i]; }
            }
            if (sum == s) cnt++;
        } while(next_permutation(arr, arr+10));

        cout << cnt << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:51: error: expected ';' before '}' token
   15 |         for (int i = 0; i < n; i++) { arr[9-i] = 1 };
      |                                                   ^~
      |                                                   ;
Language: C++

#include <iostream>
#include <bitset>

using namespace std;

int main() {
    int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    int n, s, sum, cnt;

    while (cin >> n >> s) {
        if (!n && !s) { break; }
        cnt = 0;
        for (int i = 0; i < (1 << 10); i++) {
            sum = 0;
            for (int j = 0; j < 10; j++) {
                // if (bitset<10>(i).test(j)) {
                if (i >> j) & 1) {
                    sum += a[j];
                }
            }
            if (sum == s && bitset<10>(i).count() == n) { cnt++; }
        }
        cout << cnt << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: lvalue required as unary '&' operand
   17 |                 if (i >> j) & 1) {
      |                               ^
Language: C++

#include <iostream>
#include <stack>

using namespace std;

struct sets { int i, sum, k; };

int n, s, cnt;
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

void dfs(int i, int sum, int k) {
    stack<sets> S;
    S.push(sets{i, sum, k});

    while (!S.empty()) {
        set u = S.top();
        if (u.k == n && u.sum == s) { cnt++; }

        if (u.i == 10 && u.k == 0 && u.sum == 0) { break; }

        if (u.i < 10 && u.k < n) {
            S.push(sets{u.i + 1, u.sum, u.k});
            S.push(sets{u.i + 1, u.sum + a[u.i], u.k + 1});
        }
        else if (u.i == 10) {
            int tmp = u.k;
            while (S.top().k == tmp) { S.pop(); }
        }
        else { S.pop(); }
    }
}

int main() {
    while (cin >> n >> s) {
        if (!n && !s) { break; }
        cnt = 0;
        dfs(0, 0, 0);
        cout << cnt << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:16:9: error: 'set' was not declared in this scope
   16 |         set u = S.top();
      |         ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    2 | #include <stack>
  +++ |+#include <set>
    3 | 
a.cc:17:13: error: 'u' was not declared in this scope
   17 |         if (u.k == n && u.sum == s) { cnt++; }
      |             ^
a.cc:19:13: error: 'u' was not declared in this scope
   19 |         if (u.i == 10 && u.k == 0 && u.sum == 0) { break; }
      |             ^
a.cc:21:13: error: 'u' was not declared in this scope
   21 |         if (u.i < 10 && u.k < n) {
      |             ^
Language: C++

def inputcase():
	global n,s
	n,s = map(int,input().split())
	return n!=0 or s!=0

memo = [[[0 for j in range(123)] for i in range(11)] for k in range(11)]
done = [[[False for j in range(123)] for i in range(11)] for k in range(11)]

def dfs(k, l, t):
	if t < 0:
		return 0
	elif k == 0 and t > 0:
		return 0
	elif k == 0:
		return 1
	elif l > 9:
		return 0
	if done[k][l][t]:
		return memo[k][l][t]
	done[k][l][t] = True
	for i in range(l,10):
		memo[k][l][t] += dfs(k-1,i+1,t-i)
	return memo[k][l][t]

while inputcase():
	print(dfs(n,0,s))



Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def inputcase():
      | ^~~
Language: C++

#include <stdio.h>
int n, s, count = 0, digits[10]; // n 個の整数の和がsになる
void dfs(int cur) {              // cur = 0   {}
   if(cur == n) {               // cur = 1   {a}
       int sum = 0;             // cur = 2   {a, b}
       for(int i = 0; i < n; i++) { sum += digits[i]; }
       if(sum == s) { count++; }
       return;
   }
   for(int i = 0; i < 10; i++) {
       digits[cur] = i; // FIXME: 重複を避ける
       dfs(cur+1);  
   }
}
int main(void){
   n = 3; s = 6; count = 0;
   dfs(0);
   printf("%d\n", count);
 scanf("%d",&n);
    scanf("%d",&s);

    func(0,0,0);

    printf("%d",count);
  return 0;
}


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

#include <stdio.h>
int n, s, count = 0, digits[10]; // n 個の整数の和がsになる
void dfs(int cur) {              // cur = 0   {}
   if(cur == n) {               // cur = 1   {a}
       int sum = 0;             // cur = 2   {a, b}
       for(int i = 0; i < n; i++) { sum += digits[i]; }
       if(sum == s) { count++; }
       return;
   }
   for(int i = 0; i < 10; i++) {
       digits[cur] = i; // FIXME: 重複を避ける
       dfs(cur+1);  
   }
}
int main(void){
   n = 3; s = 6; count = 0;
   dfs(0);
   printf("%d\n", count);
 scanf("%d",&n);
    scanf("%d",&s);
    func(0,0,0);

    printf("%d",count);
  return 0;
}


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

include <iostream>
using namespace std;
int dfs(int n, int s, int x){
   int sum=0;
   if(n==0 && s==0) return 1;
   if(n>0){
       for(int i =x; i<10; i++){
           if(s-i>=0)  sum+=dfs(n-1, s-i, i+1);
       }
   }
   return sum;
}

int main(){
   int n, s;
   while(cin >> n >> s, n||s){
       cout << dfs(n, s, 0) << endl;
   }
   return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:16:10: error: 'cin' was not declared in this scope
   16 |    while(cin >> n >> s, n||s){
      |          ^~~
a.cc:17:8: error: 'cout' was not declared in this scope
   17 |        cout << dfs(n, s, 0) << endl;
      |        ^~~~
a.cc:17:32: error: 'endl' was not declared in this scope
   17 |        cout << dfs(n, s, 0) << endl;
      |                                ^~~~
Language: C++

#include <iostream>using namespace std;
 int dfs(int n, int s, int x){
    int sum=0;
    if(n==0 && s==0)
    return 1;
    if(n>0){
        for(int i=x; i<10; i++){
            if(s-i>=0)  sum+=dfs(n-1, s-i, i+1);
        }
    }

    return sum;
}
 int main(void){
    int n, s;
    while(cin >> n >> s){
        if(n==0 && s==0)
    break;
        cout << dfs(n, s, 0) << endl;
    }
    return 0;
}



Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <iostream>using namespace std;
      |                          ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
    1 | #include <iostream>using namespace std;
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>using namespace std; int dfs(int n, int s, int x){   int sum=0;   if(n==0 && s==0)   return 1;   if(n>0){       for(int i=x; i<10; i++){           if(s-i>=0) sum+=dfs(n-1, s-i, i+1);       }   }   return sum;} int main(void){   int n, s;   while(cin >> n >> s){       if(n==0 && s==0)   break;       cout << dfs(n, s, 0) << endl;   }   return 0;}


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <iostream>using namespace std; int dfs(int n, int s, int x){   int sum=0;   if(n==0 && s==0)   return 1;   if(n>0){       for(int i=x; i<10; i++){           if(s-i>=0) sum+=dfs(n-1, s-i, i+1);       }   }   return sum;} int main(void){   int n, s;   while(cin >> n >> s){       if(n==0 && s==0)   break;       cout << dfs(n, s, 0) << endl;   }   return 0;}
      |                          ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
    1 | #include <iostream>using namespace std; int dfs(int n, int s, int x){   int sum=0;   if(n==0 && s==0)   return 1;   if(n>0){       for(int i=x; i<10; i++){           if(s-i>=0) sum+=dfs(n-1, s-i, i+1);       }   }   return sum;} int main(void){   int n, s;   while(cin >> n >> s){       if(n==0 && s==0)   break;       cout << dfs(n, s, 0) << endl;   }   return 0;}
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,s,j,k,a[11][46];
  for(int s=0;s<46;s++)for(int n=0;n<11;n++)a[n][s]=0;
  for(int i=0;i<1024;i++){
    for(j=i,n=0;j>0;j/=2)
      n += j%2;
    for(j=i,s=0,k=0;j>0;j/=2,k++)
      s += j%2*k;
    a[n][s]++;
  }
  for(cin>>n>>s;n||s;s<45?cout<<a[n][s]<<endl:0,cin>>n>>s);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: operands to '?:' have different types 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int'
   13 |   for(cin>>n>>s;n||s;s<45?cout<<a[n][s]<<endl:0,cin>>n>>s);
      |                      ~~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans

  while(cin>>n>>s){
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=i;
          count++;
        }
        tmp=tmp>>1;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  reutrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
a.cc:11:3: error: expected initializer before 'while'
   11 |   while(cin>>n>>s){
      |   ^~~~~
a.cc:29:3: error: 'reutrn' was not declared in this scope
   29 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;
  char c;

  while(cin>>n>>c>>s){
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=i;
          count++;
        }
        tmp=tmp>>1;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  reutrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
a.cc:30:3: error: 'reutrn' was not declared in this scope
   30 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;
  char c;

  while(cin>>n){
    cin>>s;
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=i;
          count++;
        }
        tmp=tmp>>1;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  reutrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
a.cc:31:3: error: 'reutrn' was not declared in this scope
   31 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;
  char c;

  while(cin>>n>>c>>s){
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=j;
          count++;
        }
        tmp=tmp/2;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  reutrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
a.cc:30:3: error: 'reutrn' was not declared in this scope
   30 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;

  while(cin>>n){
    cin>>s;
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=j;
          count++;
        }
        tmp/=2;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  reutrn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
a.cc:30:3: error: 'reutrn' was not declared in this scope
   30 |   reutrn 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;
  char c;

  while(cin>>n>>c>>s){
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=j;
          count++;
        }
        tmp=tmp>>1;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, s;
  int i, ,j, tmp;
  int sum, count;
  int ans;

  while(cin>>n){
    cin>>s;
    if(n+s==0) break;

    ans=0;
    for(i=0; i<1024; i++){
      tmp=i; sum=0; count=0;
      for(j=0; j<10; j++){
        if(tmp%2==1){
          sum+=j;
          count++;
        }
        tmp/=2;
      }
      if(count==n && sum==s) ans++;
    }
    printf("%d\n", ans);
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ',' token
    7 |   int i, ,j, tmp;
      |          ^
Language: C++

import java.util.Scanner;
public class Main {
	public static final int limit = 9;
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(true){
			int n=s.nextInt();
			int m=s.nextInt();
			if(n==0&&m==0)break;
			System.out.println(s(n,m,0));
		}

	}
	public static int s(int n,int m,int x){
		if(n==1){
			return x<=m&&m<=limit?1:0;
		}
		int a=0;
		for(int i=x;i<=limit;i++){
			a+=s(n-1,m-i,i+1);
		}
		return a;
	}
}

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

#include <cstdio.h>

using namespace std;

int get_sum(int num,int sum,int *u,int n){
	int i,j;
	if(num==0&&sum==0){
		return 1;
	}
	if(n>9){
		return 0;
	}
	return (get_sum(num-1,sum-u[n],u,n+1)+get_sum(num,sum,u,n+1));
}

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

Compiler output:
a.cc:1:10: fatal error: cstdio.h: No such file or directory
    1 | #include <cstdio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>

int dp[11][55][11];

int cnt_sum(int n, int s, int x){
  if(dp[n][s][x] != -1){
    return dp[n][s][x];
  }
  if(n == 0 && s == 0){
    return (1);
  }
  if(x>9){
    return (0);
  }
   
  return dp[n][s][x] = (cnt_sum(n-1, s-x, x+1) + cnt_sum(n, s, x+1));
}
int main(){
  int n, s;
  memset(dp,-1,sizeof(dp));
  while(1){
    scanf("%d %d", &n, &s);
    if(n == 0 && s == 0){
      break;
    }
    printf("%d\n", cnt_sum(n, s, 0));
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'memset' was not declared in this scope
   20 |   memset(dp,-1,sizeof(dp));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

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

int n,s;

int recursion(int sum,int ans,int num,int cnt){
  if(sum > s || cnt > n) return 0;
  if(cnt == n && sum == s) return 1;
  if(sum + num > s) return 0;
  int hoge = 0;
  hoge += recursion(sum+num,ans,num+1,cnt+1);
  hoge += recursion(sum,ans,num+1,cnt);
  return hoge; 
}

int main(){
  while(cin >> n >> s,n||s){;
    cout << recursion(0,0,0,0) << endl;
  }

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

#include <iostream>
using namespace std;

int res;
const int d[10]={0,1,2,3,4,5,6,7,8,9}

int main(){
	int n,s;
	
	while(cin>>n>>s,n||s){
		res=0;
		dfs(0,0,n,0,s);
		cout<<res<<endl;
	}
	
	return 0;
}
a
void dfs(int now,int idx,int n,int sum,int s){
	if(now==n&&sum==s) {
		res++;
		return true;
	}
	
	if(dfs(now,idx+1,n,sum,s)) return true;
	
	if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true;
	
	if(idx>9) return false;
	
	return false;
}

Compiler output:
a.cc:7:1: error: expected ',' or ';' before 'int'
    7 | int main(){
      | ^~~
a.cc:18:1: error: 'a' does not name a type
   18 | a
      | ^
Language: C++

#include <iostream>
using namespace std;

int res;
const int d[10]={0,1,2,3,4,5,6,7,8,9};

int main(){
	int n,s;
	
	while(cin>>n>>s,n||s){
		res=0;
		dfs(0,0,n,0,s);
		cout<<res<<endl;
	}
	
	return 0;
}
a
void dfs(int now,int idx,int n,int sum,int s){
	if(now==n&&sum==s) {
		res++;
		return true;
	}
	
	if(dfs(now,idx+1,n,sum,s)) return true;
	
	if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true;
	
	if(idx>9) return false;
	
	return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'dfs' was not declared in this scope
   12 |                 dfs(0,0,n,0,s);
      |                 ^~~
a.cc: At global scope:
a.cc:18:1: error: 'a' does not name a type
   18 | a
      | ^
Language: C++

#include <iostream>
using namespace std;

int res;
const int d[10]={0,1,2,3,4,5,6,7,8,9};

void dfs(int now,int idx,int n,int sum,int s){
	
	if(idx>9) return false;
	
	if(now==n&&sum==s) {
		res++;
		return true;
	}
	
	if(dfs(now,idx+1,n,sum,s)) return true;
	
	if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true;
	
	return false;
}

int main(){
	int n,s;
	
	while(cin>>n>>s,n||s){
		res=0;
		dfs(0,0,n,0,s);
		cout<<res<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int, int, int)':
a.cc:9:26: error: return-statement with a value, in function returning 'void' [-fpermissive]
    9 |         if(idx>9) return false;
      |                          ^~~~~
a.cc:13:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |                 return true;
      |                        ^~~~
a.cc:16:15: error: could not convert 'dfs(now, (idx + 1), n, sum, s)' from 'void' to 'bool'
   16 |         if(dfs(now,idx+1,n,sum,s)) return true;
      |            ~~~^~~~~~~~~~~~~~~~~~~
      |               |
      |               void
a.cc:16:43: error: return-statement with a value, in function returning 'void' [-fpermissive]
   16 |         if(dfs(now,idx+1,n,sum,s)) return true;
      |                                           ^~~~
a.cc:18:15: error: could not convert 'dfs((now + 1), (idx + 1), n, (sum + ((int)d[idx])), s)' from 'void' to 'bool'
   18 |         if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true;
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void
a.cc:18:52: error: return-statement with a value, in function returning 'void' [-fpermissive]
   18 |         if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true;
      |                                                    ^~~~
a.cc:20:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   20 |         return false;
      |                ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
typedef vector <vi> vvi;

vvi x(11, vi(101));
int reverse(string &s){
    int n = s.size(), n2 = n/2;
    for (int i=0; i<n2; i++)
        swap(s[i], s[n-1-i]);
    return 0;
}

string dec2bin(int n, bool r=false){
	string s="";
	while (n>0){
		if (n%2==1) s+="1";
		else s+="0";
		n/=2;
	}
	if (s=="") s="0";
	if (!r) reverse(s);
	return s;
}

int main(void){
	int m=pow(2,10);
	for (int i=0; i<10; i++)
		for (int j=0; j<101; j++)
			x[i][j] = 0;

	string s;
	for (int i=1; i<m; i++){
		s = dec2bin(i, true);
		s += string(10-s.size(),'0');

		int n=0, c=0;
		for (int i2=0; i2<s.size(); i2++)
			if (s[i2]=='1'){
				n += i2;
				c++;
			}
		x[c][n]++;		
	}

	while (true){
		int a1,a2;
		cin>>a1>>a2;
		if (a1==0 && a2==0) break;
		cout<<x[a1][a2]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: 'pow' was not declared in this scope
   29 |         int m=pow(2,10);
      |               ^~~
Language: C++

#include<iostream>
using namespace std;
int syu(int *p,int n){
  int s=0;
  for(int i=0;i<n;i++) s += p[i];
  return s;
}
int main(){
  int n,s;
  while(cin>>n>>s){
    if(n==0&&s==0) break;
    int p[n],count=0;
    for(int a=0;a<=9;a++){
      p[0] = a;
      if(n==1&&syu(p,n)==s){
 count++;
 continue;
      }
      for(int b=a+1;b<=9;b++){
 p[1] = b;
 if(n==2&&syu(p,n)==s){
   count++;
   continue;
 }
 for(int c=b+1;c<=9;c++){
   p[2] = c;
   if(n==3&&syu(p,n)==s){
     count++;
     continue;

}
     for(int d=c+1;d<=9;d++){
       p[3] = d;
       if(n==4&&syu(p,n)==s){
  count++;
  continue;

}
  for(int e=d+1;e<=9;e++){
    p[4] = e;
    if(n==5&&syu(p,n)==s){
      count++;
      continue;

}
      for(int f=e+1;f<=9;f++){
        p[5] = f;
        if(n==6&&syu(p,n)==s){
   count++;
   continue;

}
   for(int g=f+1;g<=9;g++){
     p[6] = g;
     if(n==7&&syu(p,n)==s){
       count++;
       continue;
     }
     for(int h=g+1;h<=9;h++){
       p[7] = h;
       if(n==8&&syu(p,n)==s){
         count++;
         continue;
       }      
       for(int i=h+1;i<=9;i++){
         p[8] = i;
         if(n==9&&syu(p,n)==s){
    count++;
    continue;
         }
       }
     }
   }
        }
      }
    }
  }
       }
     }
   }
 }
      }
    }
    cout << count << endl;
  }
  return 0;
}

Compiler output:
a.cc:82:7: error: expected declaration before '}' token
   82 |       }
      |       ^
a.cc:83:5: error: expected declaration before '}' token
   83 |     }
      |     ^
a.cc:84:5: error: 'cout' does not name a type
   84 |     cout << count << endl;
      |     ^~~~
a.cc:85:3: error: expected declaration before '}' token
   85 |   }
      |   ^
a.cc:86:3: error: expected unqualified-id before 'return'
   86 |   return 0;
      |   ^~~~~~
a.cc:87:1: error: expected declaration before '}' token
   87 | }
      | ^
Language: C++

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

int t;
int n[10];

void sousa(int a, int b){
	for(n[a-1] = n[a]; n[a-1] >= 0; n[a-1]--){
		if(a-1 < 0 || b < 0){
			cout << "out" << endl;
			break;
		}
		else if(a-1 == 0 && b-n[a-1] == 0){
			cout << "ok" << endl;
			t++;
			break;
		}
		else{
			cout << "lasting" << endl;
			sousa(a-1, b-n[a-1]);
		}
	}
}
int main(){
	vector<int> array;
	int n, m;
	while(cin >> n >> m){
		n[a] = 9;
		if(n == 0 && m == 0){
			break;
		}
		if(m > 45){
			array.push_back(0);
			continue;
		}
		t = 0;
		sousa(n, m);
		array.push_back(t);
	}
	for(int i = 0; i < array.size(); i++){
		cout << array[i]/2 << endl;
	}
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: 'a' was not declared in this scope
   29 |                 n[a] = 9;
      |                   ^
Language: C++

#include<stdio.h>

int count=0;
int s,n;

void ans(int i,int n,int sum);

void main()
{

	while(scanf("%d %d",&n,&s),n){
		count=0;
		ans(0,0,0);
		printf("%d\n",count);
	}
}

void ans(int i,int sum,int ele)
{
	if(i==n){
		if(sum==s)
			count++;
	}
	else{
		if(ele<=9){
			ans(i+1,sum+ele,ele+1);
			ans(i,sum,ele+1);
		}
	}
}

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

import java.util.*;
public class Main {
	static int ans,n;
	
	//nowN->現在の足した回数  Sum->足した合計値  before->前の数
	static int dfs(int nowN, int Sum, int before) {
		int count = 0;
		if(Sum > ans) return(0);
		
		if(nowN == n) {
			if(Sum == ans) return(1);
			else           return(0);
		}
		for(int r = before; r < 10; r++) {
			count += dfs(nowN + 1, Sum + r, r + 1);
		}
		return(count);
	}
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner stdIn = new Scanner(System.in);
		n = -1;
		ans = -1;
		while(ans != 0 && n != 0) {
			n = stdIn.nextInt();
			ans = stdIn.nextInt();
			if(n == 0 && ans == 0) break;
			
			int result = dfs(0, 0, 0);
			System.out.println(result);
			
		}
		
	}

}

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

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


public class AOJ_Volume0031 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int[] value = new int[10];
		int x = 512;
		List<Integer> v = new ArrayList<Integer>();
		for(int i=0;i<10;i++){
			value[i] = x;
			x /= 2;
		}

		while(sc.hasNext()){
			int w = sc.nextInt();
			v.clear();
			for(int i=0;i<10;i++){
				if(value[i] <= w){
					w -= value[i];
					v.add(value[i]);
				}
			}
			for(int i=v.size()-1; i >= 0 ; i--){
				if(i == 0) {
					System.out.println(v.get(i));
				}else{
					System.out.print(v.get(i) + " ");
				}
			}
		}
	}
}

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

import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		new Main().run();
	}

	void run(){
		Scanner sc =  new Scanner(System.in);
		while(true){
			if(!sc.hasNext()){
				break;
			}
			int a = sc.nextInt();
			int[] b = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
			for(int i=0; i < b.length; i++){
				//System.out.println("a is " + a +": b is " + b[i]);
				if(a >= b[i]){
					System.out.print(b[i]+" ");
				}
			}
			System.out.println("");
		}
	}

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

import java.io.*

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str;
boolean[] flag=new boolean[10];
while((str=br.readLine())!=null){
int n=Integer.parseInt(str);
int t=9;
while(t>=0){
int Math.pow(2,t);
n=(n>=p)?n-p:n;
flag[t]=(n>=p)?true:false;
t--;
}
}
for(int i=0;i<10;i++){
if(flag[i]){
System.out.print(Math.pow(2,i));
if(i==9){
System.out.println("");
}
else{
System.out.print(" ");
}
}
}
}
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*
                ^
Main.java:12: error: ';' expected
int Math.pow(2,t);
        ^
2 errors
Language: Java

import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str;
boolean[] flag=new boolean[10];
while((str=br.readLine())!=null){
int n=Integer.parseInt(str);
int t=9;
while(t>=0){
int p=Math.pow(2,t);
n=(n>=p)?n-p:n;
flag[t]=(n>=p)?true:false;
t--;
}
}
for(int i=0;i<10;i++){
if(flag[i]){
System.out.print(Math.pow(2,i));
if(i==9){
System.out.println("");
}
else{
System.out.print(" ");
}
}
}
}
}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from double to int
int p=Math.pow(2,t);
              ^
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		
		int[] dou = new int[10];
		for(int i = 0 ; i < 10; i++){
			dou[i] = Math.pow(2, i);
		}
		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int n = scan.nextInt();
			for(int i = 10 - 1; i >= 0; i--){
				if(n > dou[i]){
					n = n-dou[i];
					list.add(i);
				}
				if(n == dou[i]){
					n = n-dou[i];
					list.add(i);
					break;
				}
			}
			Collections.sort(list);
			for(int i = 0; i < list.size(); i++){
				int j = list.get(i);
				if(i == list.size -1){
					System.out.printf("%d\n", dou[j]);
				} else{
					System.out.printf("%d ", dou[j]);
				}
			}
		}
	}
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to int
			dou[i] = Math.pow(2, i);
			                 ^
Main.java:29: error: cannot find symbol
				if(i == list.size -1){
				            ^
  symbol:   variable size
  location: variable list of type List<Integer>
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){

		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int w = scan.nextInt();
			for(int i = 10-1; i >= 0; i--){
				if(w > Math.pow(2, i)){
					w = w - Math.pow(2, i);
					list.add(i);
				} else if(w == Math.pow(2, i){
					list.add(i);
				}
			}
			Collections.sort(list);
			for(int i = 0; i < list.size(); i++){
				int j =(int) list.get(i);
				if(i == list.size()-1){
					System.out.printf("%d\n", Math.pow(2, j);
				} else{
					System.out.printf("%d ", Math.pow(2, j);
				}
			}
		}
	}
}

Compiler output:
Main.java:15: error: ')' expected
				} else if(w == Math.pow(2, i){
				                             ^
Main.java:23: error: ')' or ',' expected
					System.out.printf("%d\n", Math.pow(2, j);
					                                        ^
Main.java:25: error: ')' or ',' expected
					System.out.printf("%d ", Math.pow(2, j);
					                                       ^
3 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){

		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int w = scan.nextInt();
			for(int i = 10-1; i >= 0; i--){
				if(w > Math.pow(2, i)){
					w = w - Math.pow(2, i);
					list.add(i);
				} else if(w == Math.pow(2, i)){
					list.add(i);
				}
			}
			Collections.sort(list);
			for(int i = 0; i < list.size(); i++){
				int j =(int) list.get(i);
				if(i == list.size()-1){
					System.out.printf("%d\n", Math.pow(2, j));
				} else{
					System.out.printf("%d ", Math.pow(2, j));
				}
			}
		}
	}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){

		List<Integer> list = new ArrayList<Integer>();
		while(scan.hasNext()){
			int w = scan.nextInt();
			for(int i = 10-1; i >= 0; i--){
				if(w > Math.pow(2, i)){
					w = w - Math.pow(2, i);
					list.add(i);
				} else if(w == Math.pow(2, i)){
					list.add(i);
				}
			}
			Collections.sort(list);
			for(int i = 0; i < list.size(); i++){
				int j =(int) list.get(i);
				if(i == list.size()-1){
					System.out.printf("%d\n", Math.pow(2, j));
				} else{
					System.out.printf("%d ", Math.pow(2, j));
				}
			}
		}
	}
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from double to int
					w = w - Math.pow(2, i);
					      ^
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		StringBuffer sb = new StringBuffer();
		while(scan.hasNext()){
			int w = scan.nextInt();
			int i = 1;
			while(i <= 512){
				if((w & i) == i){
					sb.append(i).append(' ');
				}
				i = i << 1;
			}
			String s = sb.toString().trim();
			System.out.printf("%s\n" s);
		}
	}
}

Compiler output:
Main.java:18: error: ')' or ',' expected
			System.out.printf("%s\n" s);
			                        ^
Main.java:18: error: not a statement
			System.out.printf("%s\n" s);
			                         ^
Main.java:18: error: ';' expected
			System.out.printf("%s\n" s);
			                          ^
3 errors
Language: Java

import java.util.*;

public class A{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		StringBuffer sb = new StringBuffer();
		while(scan.hasNext()){
			int w = scan.nextInt();
			int i = 1;
			sb.setLength(0);
			while(i <= 512){
				if((w & i) == i){
					sb.append(i).append(' ');
				}
				i = i << 1;
			}
			String s = sb.toString().trim();
			System.out.printf("%s\n", s);
		}
	}
}

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

#include <cstdio>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>

using namespace std;

#define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++)
#define rrep(i,a,n) for(int (i)=(n)-1;(i)>=a;(i)--)
#define all(x) (x).begin(),(x).end()

typedef long long ll;

const int INF = 1e9;

int main() {
    int n;
	while (scanf("%d", &n) != EOF) {
		vector<int> list;
		int x = 512;
		while (n > 0) {
			if (n >= x) {
				list.push_back(x);
				n -= x;
			}
			x >>= 1;
		}
		reverse(all(list));
		for (int i = 0; i < list.size(); i++) {
			if (i > 0) cout << " ";
			cout << list[i];
		}
		cout << endl;
	}
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <cstdio>
^
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <sstream>
^
Main.java:4: error: illegal character: '#'
#include <algorithm>
^
Main.java:5: error: illegal character: '#'
#include <vector>
^
Main.java:6: error: illegal character: '#'
#include <string>
^
Main.java:7: error: illegal character: '#'
#include <map>
^
Main.java:8: error: illegal character: '#'
#include <set>
^
Main.java:12: error: illegal character: '#'
#define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++)
^
Main.java:12: error: class, interface, enum, or record expected
#define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++)
        ^
Main.java:12: error: class, interface, enum, or record expected
#define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++)
                                 ^
Main.java:12: error: class, interface, enum, or record expected
#define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++)
                                              ^
Main.java:13: error: illegal character: '#'
#define rrep(i,a,n) for(int (i)=(n)-1;(i)>=a;(i)--)
^
Main.java:13: error: class, interface, enum, or record expected
#define rrep(i,a,n) for(int (i)=(n)-1;(i)>=a;(i)--)
                                      ^
Main.java:13: error: class, interface, enum, or record expected
#define rrep(i,a,n) for(int (i)=(n)-1;(i)>=a;(i)--)
                                             ^
Main.java:14: error: illegal character: '#'
#define all(x) (x).begin(),(x).end()
^
Main.java:18: error: class, interface, enum, or record expected
const int INF = 1e9;
^
Main.java:34: error: not a statement
			if (i > 0) cout << " ";
			                ^
Main.java:35: error: not a statement
			cout << list[i];
			     ^
Main.java:37: error: not a statement
		cout << endl;
		     ^
Main.java:20: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:22: error: illegal start of expression
	while (scanf("%d", &n) != EOF) {
	                   ^
22 errors
Language: Java

import java.util.*;

public class Vol0_31{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		StringBuffer sb = new StringBuffer();
		while(scan.hasNext()){
			int w = scan.nextInt();
			int i = 1;
			while(i <= 512){
				// ????????????1???????????????????£??????´???1????????????????????????AND????????? &
				// w & i ???????????????1??????????£??????´???1?????????
				// w??¨i???2?????°??¨????????????????????§??????????????°?????§?????????
				if((w & i) == i){
					sb.append(i).append(' ');
				}
				// <<??????????????????
				// i << 1 ??????i?????????1????????????????????????
				// ????????????2???1????????????2????????????
				i = i << 1;
			}
			// <<String>>.trim()?????????????????????????????????
			String s = sb.toString().trim();
			System.out.printf("%s\n", s);
		}
	}
}

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

import java.util.*;

public class Vol0_31{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		StringBuffer sb = new StringBuffer();
		while(scan.hasNext()){
			int w = scan.nextInt();
			int i = 1;
			while(i <= 512){
				if((w & i) == i){
					sb.append(i).append(' ');
				}
				i = i << 1;
			}
			String s = sb.toString().trim();
			System.out.printf("%s\n", s);
		}
	}
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNext){
		    boolean flag[] = new boolean[10];
		    int in = s.nextInt();
		    int a = 1024;
     		    for(int i=9 ; i>=0 ; i--){
			a /= 2;
			if(in>=a){
			    in -= a;
			    flag[i] = true;
			}
		    }
		    int b = 1;
		    for(int i=0 ; i<10 ; i++){
			if(flag[i]==true)
			    System.out.print(b + " ");
			b *= 2;
		    }
		    System.out.println();
		}
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		while(s.hasNext){
		       ^
  symbol:   variable hasNext
  location: variable s of type Scanner
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNext){
		    boolean flag[] = new boolean[10];
		    int in = s.nextInt();
		    int a = 1024;
		    int n = 0;
     		    for(int i=9 ; i>=0 ; i--){
			a /= 2;
			if(in>=a){
			    in -= a;
			    flag[i] = true;
			    n++;
			}
		    }
		    int b = 1;
		    for(int i=0 ; i<10 ; i++){
			if(flag[i]==true)
			    n--;
			System.out.print(b);
			if(n!=0)
			    System.out.print(" ");
			b *= 2;
		    }
		    System.out.println();
		}
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		while(s.hasNext){
		       ^
  symbol:   variable hasNext
  location: variable s of type Scanner
1 error
Language: Java

public class weight {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int input=32;
		System.out.println("Input:"+input);
		System.out.print("Output:");
		System.out.println(weight(input));
	}
	public static String weight(int num){		//num=蛟、縲〔=菫よ焚
		int number=num;
		String sub="";		//途中経過
		String result="";	//結果
		int k=0;
		
		while(number>1){
			//int ans=number%2;
			//System.out.println("number="+number);
			int ans=(number%2);
			sub=ans+","+sub;
			number=number/2;
			k++;
		}
		sub=number+","+sub;
		//System.out.println("sub:"+sub);
		String[] div_sub=sub.split(",");
		for(int i=0;i<div_sub.length;i++){
			int x=(int)Math.pow((double)2,(double)(k-i));
			int ans=x*Integer.parseInt(div_sub[i]);
			//System.out.println("ans("+(k-i)+","+x+")="+ans);
			if(ans!=0){
				if(!result.equals(""))result=ans+" "+result;
				else result=""+ans;	
			}
		}
		return result;
	}
}

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