Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 0

		for i := 0; i < 10; i++ {
			for j := 0; j < 10; j++ {
				for k := 0; k < 10; k++ {
					for l := 0; l < 10; l++ {
						if i+j+k+l == a {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

C++: #include <iostream>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

int main(void){
	int n;
	int count[51];

	rep(i,51) count[i] = 0;
	rep(a,10)rep(b,10)rep(c,10)rep(d,10){
		count[a+b+c+d]++;
	}

	while(cin>>n){
		cout<<count[n]<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    const int max = 50;
    int counters[max];
    int a, b, c, d, i, maxUsable, target = 0, index;

    for (i = 0; i < max; i++) {
        counters[i] = -1;
    }

    while (cin >> target) {
        index = target-1;

        // 前回の計算結果があればそれを出力
        if (counters[index] != -1) {
            cout << counters[index] << endl;
            continue;
        }

        // 総当りで計算
        if (counters[index] == -1) counters[index] = 0;

        maxUsable = target >= 9 ? 9 : target;
        for (a = 0; a <= maxUsable; a++) {
            for (b = 0; b <= maxUsable; b++) {
                for (c = 0; c <= maxUsable; c++) {
                    for (d = 0; d <= maxUsable; d++) {
                        if (a + b + c + d == target) {
                            counters[index]++;
                        }
                    }
                }
            }
        }

        // 結果の出力
        cout << counters[index] << endl;
    }

    return 0;
}

C++: #include<stdio.h>

int main(){
	int n;
	while(~scanf("%d",&n)){
		int i=0;
		for(int a=0;a<10;a++)
			for(int b=0;b<10;b++)
				for(int c=0;c<10;c++)
					for(int d=0;d<10;d++)
						if(a+b+c+d==n)i++;
		printf("%d\n",i);
	}
}

C++: #include <iostream>
int n = 0;
int main(void){
    int a, b, c, d;
    int cnt;
    while(std::cin >> n){
        cnt = 0;
        for(a=0; a<=9; ++a) for(b=0; b<=9; ++b) for(c=0; c<=9; ++c) for(d=0; d<=9; ++d) if(a+b+c+d == n) cnt++;
        std::cout << cnt << std::endl;
    }
}

C++: #include <iostream>

using namespace std;

int main ( void )
{
 int n;
 while (cin >> n)
 {
  int count = 0;
  for (int a = 0; a <= 9; ++a)
   for (int b = 0; b <= 9; ++b)
    for (int c = 0; c <= 9; ++c)
    {
      int d = n - ( a + b + c );
      if ( 0 <= d && d <= 9 ) ++count;
    }
  cout << count << endl;
 }
 return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
	int n,val;
	while(cin >> n;){
		val = 0;
		for(int i=0;i<=9;i++){
			for(int j=0;j<=9;j++){
				for(int k=0;k<=9;k++){
					for(int l=0;l<=9;l++){
						if(i+j+k+l == n){
							val += 1;
						}
					}
				}
			}
		}
		cout << val << endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main(void){
    int n,cnt;
    
    while (scanf("%d", &n)!=EOF){
        cnt = 0;
        for (int i=0; i<10; i++){
            for (int j=0; j<10; j++){
                for (int k=0; k<10; k++){
                    for (int l=0; l<10; l++){
                        cnt += (i+j+k+l)==n ? 1 : 0;
                    }
                }
            }
        }
        printf("%d\n", cnt);
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans=0;
	cin>>n;
	for(a=0;a<=min(n,9);a++){
		k = n-a;
		for(b=0;b<=min(9,k);b++){
			l = k-b;
			for(c=0;c<=min(9,l);c++){
				m = l-c;
				if(0 <= m && m<10){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,count,a,b,c,d;
	while(cin >> n){
		count = 0;
		for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				for(c=0;c<10;c++){
					for(d=0;d<10;d++){
						if(a+b+c+d == n) count += 1;
					}
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
    int main(void){
    int i,j,k,l,n,m,cut;
    while(scanf("%d",&n)!=EOF){
    cut=0;
    for(i=0;i<10;i++){
        for(j=0;j<10;j++){
            for(k=0;k<10;k++){
                for(l=0;l<10;l++){
                    m=i+j+k+l;
                    if(n==m){
                        cut++;
                    }
                }
            }
        }
    }
        printf("%d",cut);
    }
    return 0;
    }

C++: #include <iostream>
using namespace std;

int main() {
	int n, i, j, k, l, ans;
	while (cin >> n) {
		ans = 0;
		for (i = 0; i <= 9; i++) {
			if (i > n) continue;
			for (j = 0; j <= 9; j++) {
				if (i + j > n) continue;
				for (k = 0; k <= 9; k++) {
					if (i + j + k > n) continue;
					for (l = 0; l <= 9; l++)
						if (i + j + k + l == n) {
							ans++; break;
						}
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<queue>
using namespace std;
int dp[10][10][10][10]={-1};
int jisaku(int i,int j,int k,int l){
	if(dp[i][j][k][l]>=0){
		return dp[i][j][k][l];
	}
	else{
		dp[i][j][k][l]=i+j+k+l;
		return i+j+k+l;
	}
}
int main(){
	int i,j,k,l,n,ans=0,a;
	cin>>n;
	for(i=0;i<=9;i++){
		for(j=0;j<=9;j++){
			for(k=0;k<=9;k++){
				for(l=0;l<=9;l++){
					a=i+j+k+l;
					if(a==n){
						ans++;
					}
				}
			}
		}
	}
	cout<<ans<<endl;
}

C++: #include<iostream>

using namespace std;
int n;
int bfs(int now,int d){
	int ans=0;
	if(d==4){
	if(now==n)return 1;
	else return 0;
	}
	else{
	for(int i=0;i<10;i++)ans+=bfs(now+i,d+1);
	}
	return ans;
}

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

C++: #include<iostream>
using namespace std;
 
int main()
{
    int n,ans;
    n=0;
    while(cin>>n){
        ans=0;
        for(int a=0;a<10;a++){
            for(int b=0;b<10;b++){
                for(int c=0;c<10;c++){
                    for(int d=0;d<10;d++){
                        if(a+b+c+d==n)
                            ans++;
                    }
                }
            }
        }
        cout<<ans<<endl;
    }
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF 999999

using namespace std;

typedef long long ll;

int main()
{
	int n;
	
	while (cin >> n) {
		int count = 0;
		for (int i = 0; i <= 9; i++) {
			for (int j = 0; j <= 9; j++) {
				for (int k = 0; k <= 9; k++) {
					if (n - 9 <= i + k + j&&i + k + j <= n)count++;
				}
			}
		}
		cout << count << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include <string.h>

int dp[51][5];

void init() {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i <= 50; ++i) {
    for (int j = 1; j <= 4; ++j) {
      for (int t = 0; t < 10 && t <= i; ++t) {
        dp[i][j] += dp[i-t][j-1];
      }
    }
  }
}

int main() {
  //freopen("SumOf4Integers.in", "r", stdin);
  int n;
  init();
  while (scanf("%d", &n) == 1) {
    int result = dp[n][4];
    printf("%d\n", result);
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	int count = 0;
	cin >> n;
	for(int a = 0; a <= 9; a++){
		for(int b = 0; b <= 9; b++){
			for(int c = 0; c <= 9; c++){
				for(int d = 0; d <= 9; d++){
					if(a + b + c + d == n) count++;
				}
			}
		}
	}
	cout << count << endl;

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int a,b,c,d,n;
	int succed;

	while( cin >> n ){
		succed = 0;
		for( a = 0;a <= 9;a++ ){
			for( b = 0;b <= 9;b++ ){
				for( c = 0;c <= 9;c++ ){
					for( d = 0;d <= 9;d++ ){
						if( a + b + c + d == n ) succed++;
					}
				}
			}
		}
		cout << succed << endl;
	}
	return 0;
}