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

#include<iostream>

int dp[30];//段数ー１

int main(){
	int n;
	while(std::cin>>n,n){
		memset(dp,0,sizeof(dp));
		dp[0]=1;
		dp[1]=2;
		dp[2]=4;
		for(int i=3;i<n;i++){
			dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
		}
		if(dp[n-1]%365==0)std::cout<<dp[n-1]/3650<<std::endl;
		else std::cout<<dp[n-1]/3650+1<<std::endl;
	}
	return 0;
}

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

#include<iostream>

int dp[30];//段数ー１

int main(){
	int n;
	while(std::cin>>n,n){
		std::memset(dp,0,sizeof(dp));
		dp[0]=1;
		dp[1]=2;
		dp[2]=4;
		for(int i=3;i<n;i++){
			dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
		}
		if(dp[n-1]%365==0)std::cout<<dp[n-1]/3650<<std::endl;
		else std::cout<<dp[n-1]/3650+1<<std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
    8 |                 std::memset(dp,0,sizeof(dp));
      |                      ^~~~~~
      |                      wmemset
Language: C++

#include<iostream>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;

void solve(){
 int n;
  long long a[30] = {1,2,4};
  loop(i,3,30)a[i] = a[i-1] + a[i-2] + a[i-3];
  while(cin>>n,n)
    cout<<i+a[n-1]/3650<<endl;
}
int main(void){
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:11:11: error: 'i' was not declared in this scope
   11 |     cout<<i+a[n-1]/3650<<endl;
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n;
  int m[31] = {1,1,2};
  loop(i,3,31)
    m[i] = m[i-1] + m[i-2] + m[i-3];
  while(cin>>n,n)
    cout<<m[i]/3650 + 1 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'i' was not declared in this scope
   32 |     cout<<m[i]/3650 + 1 <<endl;
      |             ^
Language: C++

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

int solve(int n);
int dp[100];

int main(){
	int n;
	while(cin >> n , n){
		memset(dp,0,n+2);
		int ans = solve(n);
		cout << ans/365/10+1 << endl;
	}
}

int solve(int n){
	if(n == 0) return 1;
	if(dp[n] != 0) return dp[n];
	int cou=0;
	for(int i=1;i<=3;i++){
		if(n-i >= 0) cou += solve(n-i);
	}
	return dp[n] = cou;
}

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

#include<iostream>
using namespace std;
int main(){
  int ans[31]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,6,10,19,34,62,113,207,381,701,1288,2369,4357,8014,14740}
  while(1){
    cin>>ans[0];
    if(!ans[0])
      return 0;
    cout<<ans[ans[0]];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected ',' or ';' before 'while'
    5 |   while(1){
      |   ^~~~~
Language: C++

#include<iostream>
using namespace std;
int n;
int mamo[31], ans[31];
int main(){
  while(cin>>n){
    if(!n)
      return 0;
    memo[0]=1;
    memo[1]=1;
    memo[2]=2;
    for(int i=3;i<=n;i++){
      if(!memo[i]){
	memo[i]=memo[i-1]+memo[i-2]+memo[i-3];
      }
    }
      if(memo[n]%3650)
      ans[n]+=1;
      ans[n]+=memo[n]/3650;
      cout<<ans[n]<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'memo' was not declared in this scope; did you mean 'mamo'?
    9 |     memo[0]=1;
      |     ^~~~
      |     mamo
Language: C++

include<iostream>

using namespace::std;

int fib(int n) {
	


	int x[100];
	x[0] = 0;
	x[1] = 1;
	x[2] = 2;
	x[3] = 4;

	for (int i = 4; i <= n; i++) {
		x[i] = x[i - 3] + x[i - 2] + x[i - 1];
	}
	return x[n];
}


int main() {
	
	cin >> n;
	int ans;
	int ama;

	ans = n / 3;
	ans = ans * 4;

	if (n % 3 == 1) {
		ans +=
	}
	else if (n % 3 == 2) {

	}*/
	int a[100];
	int i= 0;

	while (true) {
		cin >>a[i];
		if (a[i] == 0)
			break;
		i++;
	}

	for (int j = 0; j < i; j++) {
		if (a[j] != 0) {
			cout << fib(a[j])/10/ 365 + 1 << endl;
		}
		else {
			cout <<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:24:9: error: 'cin' was not declared in this scope
   24 |         cin >> n;
      |         ^~~
a.cc:24:16: error: 'n' was not declared in this scope
   24 |         cin >> n;
      |                ^
a.cc:33:9: error: expected primary-expression before '}' token
   33 |         }
      |         ^
a.cc:36:11: error: expected primary-expression before '/' token
   36 |         }*/
      |           ^
a.cc:37:9: error: expected primary-expression before 'int'
   37 |         int a[100];
      |         ^~~
a.cc:41:23: error: 'a' was not declared in this scope
   41 |                 cin >>a[i];
      |                       ^
a.cc:48:21: error: 'a' was not declared in this scope
   48 |                 if (a[j] != 0) {
      |                     ^
a.cc:49:25: error: 'cout' was not declared in this scope
   49 |                         cout << fib(a[j])/10/ 365 + 1 << endl;
      |                         ^~~~
a.cc:49:58: error: 'endl' was not declared in this scope
   49 |                         cout << fib(a[j])/10/ 365 + 1 << endl;
      |                                                          ^~~~
a.cc:52:25: error: 'cout' was not declared in this scope
   52 |                         cout <<0<<endl;
      |                         ^~~~
a.cc:52:35: error: 'endl' was not declared in this scope
   52 |                         cout <<0<<endl;
      |                                   ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a[30];
	a[0] = 1;
	a[1] = 1;
	a[2] = 2;
	for ( int i = 3; i <= 30; i++ )
		a[i] = a[i - 1] + a[i - 2] + a[i - 3];
	while ( int n; cin >> n ) 
		cout << a[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected initializer before ';' token
   11 |         while ( int n; cin >> n )
      |                      ^
a.cc:11:22: error: expected ')' before ';' token
   11 |         while ( int n; cin >> n )
      |               ~      ^
      |                      )
a.cc:11:31: error: 'n' was not declared in this scope
   11 |         while ( int n; cin >> n )
      |                               ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a[30];
	a[0] = 1;
	a[1] = 1;
	a[2] = 2;
	for ( int i = 3; i <= 30; i++ )
		a[i] = a[i - 1] + a[i - 2] + a[i - 3];
	while ( cin >> n ) {
		int n;
		cin >> n;
		if ( n == 0 ) break;
		cout << a[n] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: 'n' was not declared in this scope
   11 |         while ( cin >> n ) {
      |                        ^
Language: C++


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

int A[128], n, a; 
int main() {
	while(cin >> n && n >0){
		A[0] = 0;
		A[1] = 1;
		A[2] = 2;
		for (int i=3; i<=n+10; ++i) {
			A[i] = A[i-1]+A[i-2]+A[i-3];
		}
		a = (A[n]+9)/10
		a = (a+364)/365;
	cout << a <<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: expected ';' before 'a'
   15 |                 a = (A[n]+9)/10
      |                                ^
      |                                ;
   16 |                 a = (a+364)/365;
      |                 ~
Language: C++

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

int A[128], n, a; 
int main() {
	while(cin >> n && n >0){
		A[0] = 0;
		A[1] = 1;
		A[2] = 2;
		for (int i=3; i<=n+10; ++i) {
			A[i] = A[i-1]+A[i-2]+A[i-3];
		}
		a = int((A[n]+9)/10);
		a = int(a+364)/365);
	cout << a <<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: expected ';' before ')' token
   15 |                 a = int(a+364)/365);
      |                                   ^
      |                                   ;
Language: C++


#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;

int A[128], n; 
int main() {
	while(cin >> n && n >0){
		A[0] = 0;
		A[1] = 1;
		A[2] = 2;
		for (int i=3; i<=n+10; ++i) {
			A[i] = A[i-1]+A[i-2]+A[i-3];
		}
		double a = floor((A[n]+9)/10);
		double a = floor((a+364)/365);
	cout << a <<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: redeclaration of 'double a'
   18 |                 double a = floor((a+364)/365);
      |                        ^
a.cc:17:24: note: 'double a' previously declared here
   17 |                 double a = floor((A[n]+9)/10);
      |                        ^
Language: C++

#include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(pos - 2); dfs(pos - 3); } } int main() { while (1) { int days = 0, years = 0; c = 0; cin >> x; if (x == 0) { break; } dfs(x); days = c / 10; if (c % 10 != 0) { days++; } years = days / 365; if (days % 365 != 0) { years++; } cout << years << endl; } }

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int x, c=0; void dfs(int pos) { if (pos == 1) { c++; return; }else if (pos == 2) { c = c + 2; return; } else if (pos == 3) { c = c + 4; return; } else { dfs(pos - 1); dfs(pos - 2); dfs(pos - 3); } } int main() { while (1) { int days = 0, years = 0; c = 0; cin >> x; if (x == 0) { break; } dfs(x); days = c / 10; if (c % 10 != 0) { days++; } years = days / 365; if (days % 365 != 0) { years++; } cout << years << endl; } }
      |                    ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int memo[300];
int dp(int num);

int main(void){
	while(1){
		int n;
		cin >> n;
		if(n == 0) break;

		memset(memo, -1, sizeof(memo));

		cout << (int)ceil(dp(n) / 3650.0) << endl;
		//cout << dp(n) << endl;
		
	}

	return 0;
}

int dp(int num){
	memo[0] = memo[1] = 1;
	memo[2] = 2;

	for(int i=3; i<=num; i++){
		memo[i] = memo[i-1] + memo[i-2] + memo[i-3];
	}

	return memo[num];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(memo, -1, sizeof(memo));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

int memo[300];
int dp(int num);

int main(void){
	while(1){
		int n;
		cin >> n;
		if(n == 0) break;

		memset(memo, -1, sizeof(memo));

		cout << (int)ceil(dp(n) / 3650.0) << endl;
		//cout << dp(n) << endl;
		
	}

	return 0;
}

int dp(int num){
	memo[0] = memo[1] = 1;
	memo[2] = 2;

	for(int i=3; i<=num; i++){
		memo[i] = memo[i-1] + memo[i-2] + memo[i-3];
	}

	return memo[num];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'memset' was not declared in this scope
   16 |                 memset(memo, -1, sizeof(memo));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <iostream>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

int memo[300];
int dp(int num);

int main(void){
	while(1){
		int n;
		cin >> n;
		if(n == 0) break;

		memset(memo, -1, sizeof(memo));

		cout << (int)ceil(dp(n) / 3650.0) << endl;
		//cout << dp(n) << endl;
		
	}

	return 0;
}

int dp(int num){
	if(num < 0) return 0;
	if(memo[num] != -1) return memo[num];
	if(num <= 1) return memo[num] = 1;

	return memo[num] = dp(num-1) + dp(num-2) + dp(num-3);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(memo, -1, sizeof(memo));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>


#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int n;
	int a[33];

	cin >> n;
	a[0] = a[1] = 0;
	a[2] = 1;
	for(int i = 3;i < n+3;i++){
		a[i] = a[i-3] + a[i-1] + a[i-2];
	}
	int res = a[n+2]/10/365;
	if(a[n+2]% 3650 != 0)
		res ++;
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc:17:9: error: 'vector' does not name a type
   17 |         vector<int> par;
      |         ^~~~~~
a.cc:18:9: error: 'vector' does not name a type
   18 |         vector<int> rank;
      |         ^~~~~~
a.cc: In constructor 'Union_find::Union_find(int)':
a.cc:25:25: error: 'par' was not declared in this scope
   25 |                         par.push_back(i);
      |                         ^~~
a.cc:26:29: error: expected unqualified-id before '.' token
   26 |                         rank.push_back(0);
      |                             ^
a.cc: In member function 'int Union_find::find(int)':
a.cc:31:20: error: 'par' was not declared in this scope
   31 |                 if(par[x] == x){
      |                    ^~~
a.cc: In member function 'void Union_find::unite(int, int)':
a.cc:43:24: error: expected unqualified-id before '[' token
   43 |                 if(rank[x] < rank[y]){
      |                        ^
a.cc:44:25: error: 'par' was not declared in this scope
   44 |                         par[x] = y;
      |                         ^~~
a.cc:46:25: error: 'par' was not declared in this scope
   46 |                         par[y] = x;
      |                         ^~~
a.cc:47:32: error: expected unqualified-id before '[' token
   47 |                         if(rank[x] == rank[y]) rank[x]++;
      |                                ^
a.cc:47:55: error: expected initializer before '++' token
   47 |                         if(rank[x] == rank[y]) rank[x]++;
      |                                                       ^~
a.cc:47:55: error: expected ';' before '++' token
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;
int A[32], N;
int main(){
	A[0] = 1;
	for (int i=1; i<=31; i++){
		A[i] = A[i-1];
		if (i>1) A[i] += A[i-2];
		if (i>2) A[i] += A[i-3];
	}
	while (cin >> N && N!=0){
		year = A[N]/365+1;
		cout << year << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'year' was not declared in this scope
   13 |                 year = A[N]/365+1;
      |                 ^~~~
Language: C++

// ConsoleApplication7.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <iostream>
#include <cstring>
using namespace std;

int n, dp[32];

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	while (cin >> n, n) {
		memset(dp, 0, sizeof(dp));

		dp[1] = dp[2] = dp[3] = 1;

		for (int i = 1; i < n + 1; ++i) {
			if (i + 3 < n + 1) {
				dp[i + 3] += dp[i];
			}
			if (i + 2 < n + 1) {
				dp[i + 2] += dp[i];
			}
			if (i + 1 < n + 1) {
				dp[i + 1] += dp[i];
			}
		}
		cout << dp[n] / 10 / 365 + 1<< endl;
	}

	return 0;
}

Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
solve(int now){
    if(now==0) return 1;
    if(now<0)  return 0;
    long long res=solve(now-1)+solve(now-2)+solve(now-3);
    retrun res;
}
int main(void){
    int n;
    cin>>n;
    solve(n);
    cout<<solve(n)/3650+1<<endl;
    // Your code here!
    
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
    3 | solve(int now){
      | ^~~~~
a.cc: In function 'int solve(int)':
a.cc:7:5: error: 'retrun' was not declared in this scope
    7 |     retrun res;
      |     ^~~~~~
a.cc:6:56: warning: control reaches end of non-void function [-Wreturn-type]
    6 |     long long res=solve(now-1)+solve(now-2)+solve(now-3);
      |                                                        ^
Language: C++

#include <iostream>
using namespace std;
long long solve(int now){
    if(now==0) return 1;
    if(now<0)  return 0;
    long long res=solve(now-1)+solve(now-2)+solve(now-3);
    return res;
}
int main(void){
    while(cin>>n&&n){
    cout<<solve(n)/3650+1<<endl;
    }
    // Your code here!
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'n' was not declared in this scope
   10 |     while(cin>>n&&n){
      |                ^
Language: C++

#include<iostream>

int main(void){
    int n;
    int a[31]={};
    a[0]=1;
    a[1]=1;
    a[2]=2;
    for(int i=3;i<31;i++){
        a[i]=a[i-1]+a[i-2]+a[i-3];
    }
    while(std::cin>>n){
        if(n==0) break;
        std::cout<<a[i]/3650+1<<std::endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'i' was not declared in this scope
   14 |         std::cout<<a[i]/3650+1<<std::endl;
      |                      ^
Language: C++

#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
typedef long long ll;
////////////////////////////////////////////////////////////

int main(){
	unsigned long long dp[100];
	dp[0] = 0;
	dp[1] = 1;
	dp[2] = 2;
	dp[3] = 4;
	rep(i,4,40){
		dp[i] = dp[i-1] + dp[i-2] + dp[i-3];	
		//cout << i << ":"  << dp[i] << endl;
	}
	
	rep(i,0,40){
		if(dp[i] % 10 )
			dp[i] = dp[i] / 10 + 1;
		else
			dp[i] = dp[i] / 10;
	}
	
	rep(i,0,40){
		//cout << i << ":" << dp[i] << endl;
	}

	int n;
	while( cin >> n ){
		if( dp[n] % 365 )
			cout << dp[n] / 365 + 1 << endl;
		else
			cout << dp[n] / 365 << endl;
	}



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

#include <iostream>
using namespace std;
#define rep(i,x,to) for(int i=x;i<to;i++)

int main() {
	int n,dp[30]={1,1,2};
	while(1){
		cin >> n;
		if(n==0A) break;
		rep(i,3,30){
			dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
		}
		cout << dp[n]/3650+(dp[n]%3650!=0) << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: unable to find numeric literal operator 'operator""A'
    9 |                 if(n==0A) break;
      |                       ^~
Language: C++

#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;

int main(){
    int dp[31];
    int i,n:
    dp[0]=1,dp[1]=1,dp[2]=2;
    for(i=3;i<=30;i++){
        dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
    }
    while(cin>>n&&n){
        int ans=(dp[n]-1)/(365*10)+1;
        cout<<ans<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: found ':' in nested-name-specifier, expected '::'
   14 |     int i,n:
      |            ^
      |            ::
a.cc:14:11: error: 'n' has not been declared
   14 |     int i,n:
      |           ^
a.cc:15:7: error: qualified-id in declaration before '[' token
   15 |     dp[0]=1,dp[1]=1,dp[2]=2;
      |       ^
a.cc:19:16: error: 'n' was not declared in this scope
   19 |     while(cin>>n&&n){
      |                ^
Language: C++

main()
{
	int n,i;
	int ans[64]={0};
	
	ans[0]=ans[1]=1;
	ans[2]=2;
	
	for(i=3;i<31;i++)
		ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
	
	for(;;)
	{
		cin >> n ;
		if(n==0)
			break;
		printf("%d\n",ans[n]/3650+1);
	}
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'cin' was not declared in this scope
   14 |                 cin >> n ;
      |                 ^~~
a.cc:17:17: error: 'printf' was not declared in this scope
   17 |                 printf("%d\n",ans[n]/3650+1);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main()
Language: C++

int main()
{
	int n,i;
	int ans[64]={0};
	
	ans[0]=ans[1]=1;
	ans[2]=2;
	
	for(i=3;i<31;i++)
		ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
	
	for(;;)
	{
		cin >> n ;
		if(n==0)
			break;
		printf("%d\n",ans[n]/3650+1);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'cin' was not declared in this scope
   14 |                 cin >> n ;
      |                 ^~~
a.cc:17:17: error: 'printf' was not declared in this scope
   17 |                 printf("%d\n",ans[n]/3650+1);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
Language: C++

void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}

Compiler output:
a.cc:1:1: error: '::main' must return 'int'
    1 | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:117: error: 'scanf' was not declared in this scope
    1 | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
      |                                                                                                                     ^~~~~
a.cc:1:146: error: 'printf' was not declared in this scope
    1 | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
      |                                                                                                                                                  ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void main(){int n,i,ans[64]={0};ans[0]=ans[1]=1;ans[2]=2;for(i=3;i<31;i++)ans[i]=ans[i-1]+ans[i-2]+ans[i-3];for(;;){scanf("%d",&n);if(n==0)break;printf("%d\n",ans[n]/3650+1);}}
Language: C++

void main()
{
	int n,i,ans[64];
	
	ans[0]=ans[1]=1;
	ans[2]=2;
	
	for(i=3;i<31;i++)
		ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
	
	for(;;)
	{
		scanf("%d",&n);
		if(n==0)
			break;
		printf("%d\n",ans[n]/3650+1);
	}
}

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

void main()
{
	int n,i;
	int ans[64]={0};
	
	ans[0]=ans[1]=1;
	ans[2]=2;
	
	for(i=3;i<31;i++)
		ans[i]=ans[i-1]+ans[i-2]+ans[i-3];
	
	for(;;)
	{
		scanf("%d",&n);
		if(n==0)
			break;
		printf("%d\n",ans[n]/3650+1);
	}
}

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

#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef ll long long int
ll rr(int ll){
	if(y==0)
	return 1;
	else return y*rr(y-1);
}
ll func(ll i,ll j,ll k){
	return rr(i+j+k)/(rr(i)*rr(j)*rr(k));
}
int main(){
	ll n,sum,k;
	while(cin>>n,n){
		sum=0;
		for(ll i=0;i*3<=n;i++)
		for(ll j=0;j*2+3*i<=n;j++){
			k=n-(j*2+3*i);
			sum+=func(i,j,k);
		}
		if(sum%3650>0)
		cout<<sum/3650+1<<endl;
		else
		cout<<sum/3650<<endl;
	}
	return 0;
}

Compiler output:
a.cc:4:9: error: 'll' does not name a type
    4 | typedef ll long long int
      |         ^~
a.cc:10:1: error: 'll' does not name a type
   10 | ll func(ll i,ll j,ll k){
      | ^~
a.cc: In function 'int main()':
a.cc:14:9: error: 'll' was not declared in this scope
   14 |         ll n,sum,k;
      |         ^~
a.cc:15:20: error: 'n' was not declared in this scope
   15 |         while(cin>>n,n){
      |                    ^
a.cc:16:17: error: 'sum' was not declared in this scope
   16 |                 sum=0;
      |                 ^~~
a.cc:17:23: error: expected ';' before 'i'
   17 |                 for(ll i=0;i*3<=n;i++)
      |                       ^~
      |                       ;
a.cc:17:28: error: 'i' was not declared in this scope
   17 |                 for(ll i=0;i*3<=n;i++)
      |                            ^
a.cc:18:23: error: expected ';' before 'j'
   18 |                 for(ll j=0;j*2+3*i<=n;j++){
      |                       ^~
      |                       ;
a.cc:18:28: error: 'j' was not declared in this scope
   18 |                 for(ll j=0;j*2+3*i<=n;j++){
      |                            ^
a.cc:19:25: error: 'k' was not declared in this scope
   19 |                         k=n-(j*2+3*i);
      |                         ^
a.cc:20:30: error: 'func' was not declared in this scope
   20 |                         sum+=func(i,j,k);
      |                              ^~~~
Language: C++

#include <iostream>
using namespace std;

int fib[100];

int fibonacci(int n){
  if(!fib[n]) fib[n] = fibonacci(n-1) + fibonacci(n-2) + fibonacci(n-3);
  return fib[n];
}

int main(){
  int n;
  memset(fib, 0, sizeof(fib));
  fib[0] = fib[1] = 1;
  fib[2] = 2;
  while((cin >> n), n){
    cout << (fibonacci(n)/3650 + 1) << endl;
  }
  return 0;
}

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

#include <iostream>
using namespace std;

int dp[31];

const int DIV = 3650;

int main(void)
{
	while(1){
		int num;
		cin >> num;
		if(num == 0)
			return 0;
		memset(dp,0,sizeof(dp));
		dp[0] = 1;
		for(int i=1;i<=num;++i){//どの段から？
			for(int j=1;j<=3;++j){//何段？
				if(i-j < 0)
					continue;
				dp[i] += dp[i-j];
			}
		}
		cout << ceil((double)dp[num]/DIV) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(dp,0,sizeof(dp));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:24:25: error: 'ceil' was not declared in this scope
   24 |                 cout << ceil((double)dp[num]/DIV) << endl;
      |                         ^~~~
Language: C++

#include <iostream>

using namespace std;

int p[100];

int main(){
	p[1] = 1;
	p[2] = 2;
	p[3] = 4;
	for(int i = 4; i <= 30; i++){
		p[i] = p[i-1] + p[i-2] + p[i-3];
	}

	int n;
	while(cin >> n, n){Q
		cout << p[n]/3650+1 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'Q' was not declared in this scope
   16 |         while(cin >> n, n){Q
      |                            ^
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int dp[32] = {0}, n;
	dp[0] = 1;
	dp[1] = 1;
	dp[2] = 2;

	for(int i = 3; i < 31; i++)
	{
		dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
	}

	while(cin >> n, n)
	{
		cout << (dp[n]/365)10 + 1 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before numeric constant
   41 |                 cout << (dp[n]/365)10 + 1 << endl;
      |                                    ^~
      |                                    ;
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int dp[32], n;
	dp[0] = 1;
	dp[1] = 1;
	dp[2] = 2;

	for(int i = 3; i < 31; i++)
	{
		dp[i] = dp[i-1] + dp[i-2] + dp[i-3];
	}

	while(cin >> n, n)
	{
		cout << (dp[n]/365)10 + 1 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before numeric constant
   41 |                 cout << (dp[n]/365)10 + 1 << endl;
      |                                    ^~
      |                                    ;
Language: C++

#include<iostream>

using namespace std;

int main(){

	int n;
	int dp[32];
	int ans;

	memset(dp, 0, sizeof(dp));

	while(n>0){

		cin >> n;

		for(int i=1; i<=n; i++){
			if(i==1 ||  i==2 ){dp[i] = i;}
			else if(i==3){dp[i] = 4;}
			else{
				dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
			}
		}

		ans = dp[n] / 3650;
		if(dp[n]%3650 != 0){
			ans++;
		}

		cout << ans << endl;

	}

	return 0;
}

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

#include<iostream>
#include<string>

using namespace std;

int main(){

	int n;
	int dp[32];
	int ans;

	memset(dp, 0, sizeof(dp));

	while(n>0){

		cin >> n;

		for(int i=1; i<=n; i++){
			if(i==1 ||  i==2 ){dp[i] = i;}
			else if(i==3){dp[i] = 4;}
			else{
				dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
			}
		}

		ans = dp[n] / 3650;
		if(dp[n]%3650 != 0){
			ans++;
		}

		cout << ans << endl;

	}

	return 0;
}

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

include<iostream>
using namespace std;

int main(){
  int n,c=0;
  while(true){
  cin>>n;
  if(n==0)
    break;
  int dp[n+1];
  for(int i=0;i<n+1;i++){
    if(i==0){
      dp[i]=1;
    }
    if(i==1){
      dp[i]=1;
    }
    if(i==2){
      dp[i]=2;
    }
  }
  
  for(int i=3;i<n+1;i++){
      dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
  }
  if(c==0){
    cout<<endl;
    ++c;
  }
  cout<<dp[n]/3650+1<<endl;
  }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n;
      |   ^~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout<<endl;
      |     ^~~~
a.cc:27:11: error: 'endl' was not declared in this scope
   27 |     cout<<endl;
      |           ^~~~
a.cc:30:3: error: 'cout' was not declared in this scope
   30 |   cout<<dp[n]/3650+1<<endl;
      |   ^~~~
a.cc:30:23: error: 'endl' was not declared in this scope
   30 |   cout<<dp[n]/3650+1<<endl;
      |                       ^~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int n;

int dp[35][35];

void solve() {
	memset(dp, 0, sizeof(dp));
	
	dp[0][0] = 1;
	for (int i=0; i<n; i++) {
		for (int j=0; j<=n; j++) {
			if (j>=1) dp[i+1][j] += dp[i][j-1];
			if (j>=2) dp[i+1][j] += dp[i][j-2];
			if (j>=3) dp[i+1][j] += dp[i][j-3];
		}
	}
	
	int sum = 0;
	for (int i=0; i<n; i++) {
		sum += dp[i+1][n];
	}
	sum /= 10;
	int ans = ceil((double)sum/365.0);
	if (sum > 0) cout << ans << endl;
	else cout << 1 << endl;
}

int main() {
	while (1) {
		cin >> n; if (n==0) break;
		solve();
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:11:9: error: 'memset' was not declared in this scope
   11 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cmath>
  +++ |+#include <cstring>
    3 |
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (;;) {
            String[] s = sc.nextLine().split(" ");
            int n = s.length;
            int[] l = new int[n];
            for (int i = 0; i < n; i++) 
                l[i] = Integer.parseInt(s[i]);
            if (l[0] == 0)
                break;
            Arrays.sort(l);
            int sum = 0;
            while (n-- > 0)
                sum+=l[n]!=1?Math.min(10,l[n]):sum+n<=10?11:1;
            System.out.println(sum>21?0:sum);
        }
    }
}


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

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

int main(){

	int score = 0;
	int point = 0;


	for (score = 0; score < 21;)
	{
		if (score > 21)
		{
			score = 0;
		}
		else
		{
			scanf_s("%d", &point);

			if (point == 1)
			{
				if (score < 11)
				{
					point = 11;
				}
			}

			score += point;

			printf("現在のスコア = %d", score);
		}
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   18 |                         scanf_s("%d", &point);
      |                         ^~~~~~~
      |                         scanf
Language: C

#include<cstdio>
#include<sstream>
#define MAX(x,y) ((x>y)?x:y)
using namespace std;

int main(){
	int i,j,x,sum,f,ans;
	char s[200];
	
	while(fgets(s,200,stdin)!=NULL){
		istringstream ss(s);
		f=sum=0;
		while(ss>>x){
			if(x==0)goto fin;
			if(x==1)f++;
			else if(x>9)sum+=10;
			else sum+=x;
		}
		ans=0;
		for(i=0;i<=f;i++){
			x=sum+i+11*(f-i);
			if(x>21)x=0;
			ans=MAX(ans,x);
		}
		printf("%d\n",ans);
	}
	fin:
	
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  while(getline(cin,s),s!="0"){
    stringstream ss(s);
    int x=0,i,ans;
    int si=0;
    vector<int> v;
    v.clear();
    v.push_back(0);
    
    while(ss>>x){
      si=v.size();
      for(i=0;i<si;i++){
	
	if(x==1){
	  k=v[i];
	  v.push_back(k+11);
	  v[i]++;
	}else if(x>10){
	  v[i]+=10;
	}else {
	  v[i]+=x;
	}
	
      }
    }
    
    sort(v.begin(),v.end());
    ans=0;
    for(i=0;i<v.size();i++){
      if(v[i]<=21) ans=v[i];
    }
    cout << ans << endl;
    s="";
  }  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'k' was not declared in this scope
   18 |           k=v[i];
      |           ^
Language: C++

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

int stoi(string a){
	int ret;
	stringstream ss;
	ss<<a;
	ss>>ret;
	return ret;
	}

int main(){
	string s;
	while(getline(cin,s)&&s!="0"){
		s.push_back(' ');
		int one=0;
		int sum=0;
		
		string a;
		for(int i=0;i<s.size();i++){
			if(s[i]==' '){
				int b=stoi(a);
				if(b==1)one++;
				else if(b>10)sum+=10;
				else sum+=b;
				a.clear();
				}
			else a.push_back(s[i]);
			}
			sum+=one;
			for(int i=0;i<one;i++){
				if(sum<12)sum+=10;
				}	
				
			if(sum>21)sum=0;	
			cout<<sum<<endl;	
		}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:43: error: call of overloaded 'stoi(std::string&)' is ambiguous
   22 |                                 int b=stoi(a);
      |                                       ~~~~^~~
a.cc:4:5: note: candidate: 'int stoi(std::string)'
    4 | int stoi(string a){
      |     ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++


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

int main()
{
  string s;
  char *c;
  int i, score, ace;
  while (getline(cin,s)) {
    if (s[0]=='0') break;
    score = 0;
    ace = 0;
    c = strtok((char*)s.c_str(), " ");
    while (c != NULL) {
      if (atoi(c) > 9) score += 10;
      else score += atoi(c);
      if (atoi(c) == 1) ace++;
      c = strtok(NULL, " ");
    }
    while (ace--) {
      if (score + 10 > 21) break;
      score += 10;
    }
    if (score > 21) score = 0;
    cout<<score<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
   16 |     c = strtok((char*)s.c_str(), " ");
      |         ^~~~~~
      |         strtoq
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
 char c[256]; 
 int d[100],i,s,p,f;
 while(true) {
 for (i=0;i<255;i++) c[i]=1;
 i=p=0;
 gets(c);
 if (c[0]=='0') break;
 while(true) {
	 if (c[p+2]==' ' || c[p+2]=='\0') { d[i]=(c[p]-'0')*10+(c[p+1]-'0'); p+=3;}
	 else if (c[p+1]==' ' || c[p+1]=='\0') { d[i]=(c[p]-'0'); p+=2;}
	 if (c[p-1]=='\0') break;
	 i++;
 }
 for (s=0,f=0;i>=0;i--) if (d[i]>0 && d[i]<10) { s+=d[i]; if (d[i]==1) f=1;} else s+=10;
 if (f==1 && s+10<22) s+=10;
 if (s>21) s=0;
 cout << s << endl;
 }
 return 0;
 

Compiler output:
a.cc: In function 'int main()':
a.cc:10:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |  gets(c);
      |  ^~~~
      |  getw
a.cc:23:11: error: expected '}' at end of input
   23 |  return 0;
      |           ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;

public class Main {
	int n, sum;
	String[] f;
	int[] w, s, memo, ans;
	double min;
	
	public void loop(int m, int gsum, int wsum){
		if(m==n){
			if(min>(double)gsum/wsum){
				min = (double)gsum/wsum;
				for(int i=0;i<n;i++) ans[i] = memo[i];
			}
			return;
		}
		
		for(int i=0;i<n;i++){
			boolean flag = true;
			for(int j=0;j<m;j++){
				if(memo[j]==i) flag = false;
			}
			if(flag==true){
				memo[m] = i;
				if(sum-wsum-w[i]<=s[i]){
					loop(m+1, gsum+(m+1)*w[i], wsum+w[i]);
				}
			}
		}
	}
	
	public void run(){
		Scanner sc = new Scanner(System.in);
		
		while(true){
			n = sc.nextInt();
			if(n==0) break;
			
			f = new String[n];
			w = new int[n];
			s = new int[n];
			memo = new int[n];
			Arrays.fill(memo, -1);
			ans = new int[n];
			sum = 0;
			min = Integer.MAX_VALUE;
			for(int i=0;i<n;i++){
				f[i] = sc.next();
				w[i] = sc.nextInt();
				s[i] = sc.nextInt();
				sum += w[i];
			}
			loop(0,0,0);
			for(int i=0;i<n;i++) System.out.println(f[ans[i]]);
		}
	}
	
	public static void main(String[] args) {
		new Main.run();
	}
}

Compiler output:
Main.java:59: error: cannot find symbol
		new Main.run();
		        ^
  symbol:   class run
  location: class Main
1 error
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

struct food{
  string fn;
  int g;
  int s;
};
int f[10],an[10],m;
food fd[10],sf;
int ans(int n,int s){
  if(n==-1){
    for(int i = m - 1 ; i >= 0 ; i --)
      cout << fd[an[i]].fn << endl; 
      return 1;
  }
 for (i=m-1;i>=0;i--) {
        if (f[i]==0 && fd[i].s>=s-fd[i].g) {
            f[i]=1; an[n]=i;
            if (ans(n-1,s-fd[i].g)==1) return 1; 
            f[i]=0;
        }
  }
  return 0;
}

int main(void){
  int i,j,s;
  while(cin>>m){
    if(m==0)break;
    for(i = 0 , s = 0 ; i < m ; i ++){
      f[i] = 0 ; 
      cin>>fd[i].fn>>fd[i].g>>fd[i].s;
      s+=fd[i].g;
    }
    for(i = 1 ; i < m ; i ++){
      for(j = 0  ; j < m - i ; j ++){
	if(fd[j].g>fd[j+1].g){
	  sf=fd[j];
	  fd[j] = fd[j+1];
	  fd[j+1] = sf;
	}
      }
    }
    ans(m-1,s);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int ans(int, int)':
a.cc:36:7: error: 'i' was not declared in this scope
   36 |  for (i=m-1;i>=0;i--) {
      |       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int n, w[1000], s[1000];
string S[1000]; vector<int>b; int maxn = 100000000;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> S[i] >> w[i] >> s[i];
	}
	vector<int>a(n, 0);
	for (int i = 0; i < n; i++)a[i] = i;
	do {
		for (int i = 0; i < n; i++) {
			int sum = 0;
			for (int j = i + 1; j < n; j++) {
				sum += w[a[j]];
			}
			if (sum > s[i]) goto E;
		}
		int sum2 = 0;
		for (int i = 0; i < n; i++)sum2 += i*w[i];
		if (maxn > sum2)b = a;
	E:;
	} while (next_permutation(a.begin(), a.end()));
	for (int i = 0; i < n; i++)cout << S[a[i]] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: jump to label 'E'
   26 |         E:;
      |         ^
a.cc:21:46: note:   from here
   21 |                         if (sum > s[i]) goto E;
      |                                              ^
a.cc:23:21: note:   crosses initialization of 'int sum2'
   23 |                 int sum2 = 0;
      |                     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	int n,sum,ret;
	int info[10][10];
	vector<int> data;
	while(cin >> n && n){
		data.clear();
		rep(i,n)data.push_back(i);
		rep(i,10)rep(j,10)info[i][j] = 0	;
		rep(i,n)rep(j,n){
			cin >> info[i][j];
			info[j][i] = info[i][j] = max(info[i][j],info[j][i]);
		}
		rep(i,n){
			rep(j,n)cout << info[i][j] << " "	;
			cout << endl;
		}
		ret = INT_MAX;
		do{
			sum = 0;
			for(int i=0;i+1<n;i++){
				for(int i=0;i
				sum += info[data[i]][data[i+1]];
			}
			cout << "("<< data[n-1] << ") = " << sum << endl;
			ret = min(ret,sum);
		}while(next_permutation(data.begin(),data.end()));
		cout << ret << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:46: error: expected ';' before 'sum'
   28 |                                 for(int i=0;i
      |                                              ^
      |                                              ;
   29 |                                 sum += info[data[i]][data[i+1]];
      |                                 ~~~           
a.cc:29:64: error: expected ')' before ';' token
   29 |                                 sum += info[data[i]][data[i+1]];
      |                                                                ^
      |                                                                )
a.cc:28:36: note: to match this '('
   28 |                                 for(int i=0;i
      |                                    ^