Go: package main

import (
  "fmt"
)

func main() {
  var a int
  var b int
  for _, err := fmt.Scan(&a); err == nil; _, err = fmt.Scan(&a) {
    b = 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) {
              b++
            }
          }
        }
      }
    }
  fmt.Println(b)
  }
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int n, ans = 0;

	while(cin >> n) {

		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++) {
						if(i + j + k + l == n) {
							ans++;
						}
					}
				}
			}
		}

		cout << ans << endl;

	}
}

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( scanf( "%d",&n[m] ) != EOF ) m++;

    for( int a = 0;a < m;a++ ){
    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++ ){
                    if( i+j+k+l == n[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    nCount = 0;
    }
    return 0;
}

C++: #include <cstdio>
#define REP(i,n) for(int i=0;i<(n);i++)

int main(void) {
    int n;
    const int N = 10;
    while(~scanf("%d", &n)) {
        int ans = 0;
        REP(a,N) REP(b,N) REP(c,N) REP(d,N) {
            if(a+b+c+d == n) ans++;
        }
        printf("%d\n", ans);
    }
    return 0;
}

C++: #include <stdio.h>
using namespace std;

int main(void) {
  int sum;
  while (scanf("%d", &sum)+1) {
    if (sum > 36) {
      printf("0\n");
      return 0;
    }

    int count = 0;
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 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) == sum) count++;
          }
        }
      }
    }
    printf("%d\n", count);
  }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, x, cnt;
    while(cin >> n){
        x = 0;
        for(int i = 0; i < 10; i++){
            for(int j = i; j < 10; j++){
                for(int k = j; k < 10; k++){
                    for(int l = k; l < 10; l++){
                        if(n == i + j + k + l){
                            cnt = 0;
                            if(i == j || i == k || i == l)  cnt++;
                            if(j == k || j == l)    cnt++;
                            if(k == l)  cnt++;
                            if(cnt == 3)   x++;
                            else if(cnt == 2)   x += 4; 
                            else if(cnt == 1){
                                if(i == j && j != k && k != l || j == k && i != j && k != l || k == l && i != j && j != k)  x += 12;
                                else    x += 4;
                            }
                            else    x += 24;
                        }
                    }
                }
            }
        }
        cout << x << endl;
    }
    
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n, i, j, k, l, C = 0;
	while (cin >> n){
		C = 0;
		for (i = 1; i < 10; i++){
			for (j = 1; j < 10; j++){
				for (k = 1; k < 10; k++){
					for (l = 1; l < 10; l++){
						if (n == i + j + k + l){
							C = C+1;
						}
					}
				}
			}
		}
		cout << C << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n;
    while (cin >> n) {
        int ret = 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) 
                            ret++;
        cout << ret << endl;
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,c,d,n,count;
  
  while(cin >> n){
    count = 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){count = count +1;}
	  }
	}
      }
    }
    cout << count << endl;
  }
}

C++: #include<cstdio>

using namespace std;

signed main(){
    int  n;
    while( scanf( "%d\n", &n ) != EOF )
    {
        int ret = 0l;
        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 ) ret++;
                }
            }
        }    
        printf( "%d\n", ret );
    }
    return 0;
}

C++: // 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

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

	int n;
	while(cin >> n){
		int ans = 0;
		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)ans++;
					}
				}
			}
		}
		cout << ans << '\n';
	}
	return 0;
}
// Write Here

C++: #include<iostream>

using namespace std;

int num,count,data[4];

void function(int n){

	if(n == 4){
		int sum = 0;
		for(int i=0;i<4;i++){
			sum += data[i];
		}
		if(sum == num){
			count++;
		}
	}

	else{
		for(int i=0;i<10;i++){
			data[n] = i;
			int tmpSum = 0;
			for(int j=0;j<n;j++){
				tmpSum += data[j];
			}
			if(tmpSum>35){
				break;
			}
			function(n+1);
		}
	}

}

int main(){

	int sum = 0;

	while(cin >> num){
		count = 0;

		function(0);

		cout<<count<<endl;
	}

	return 0;
}

C++: #include "stdio.h"

int main()
{
	int n, m, l;

	while(scanf("%d", &n) != EOF){
		m = n;
		l = 0;

		for (int a = 0; a < 10; a++){
			if (m < a) break;
			else m -= a;
			for (int b = 0; b < 10; b++){
				if (m < b) break;
				else m -= b;
				for (int c = 0; c < 10; c++){
					if (m < c) break;
					else m -= c;
					for (int d = 0; d < 10; d++){
						if (m < d) break;
						else if(m == d) l++;
					}
					m += c;
				}
				m += b;
			}
			m += a;
		}

		printf("%d\n", l);
	}

	return 0;
}

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

int main(void)
{
  int n;

  
  while(1)
    {
      cin >> n;
      if(cin.eof()) 
	break;

      int count = 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)
			count++;
		    }
		}
	    }
	}

      cout << count << endl;
    }

  return 0;
}

C++: #include <cstdio>

int count_combinations_of_sums(int n, int num_rests) {
  printf("%d %d\n", n, num_rests);
  if (num_rests * 9 < n) { return 0; }
  if (num_rests == 1) { return 1; }
  int count = 0;
  for (int i = 0; i <= 9 && i <= n; ++i) {
    count += count_combinations_of_sums(n - i, num_rests - 1);
  }
  return count;
}

int main() {
  int n;
  while (true) {
    if (scanf("%d", &n) != 1) { break; }
    printf("%d\n", count_combinations_of_sums(n, 4));
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int n, s;
int dp[10][100][10];
int solve(int i, int j, int k);

int main(void){
	
	while(cin >> n >> s){
		if(n == 0 && s == 0){break;}
		fill_n(**dp,10*100*10,-1);
		cout << solve(0,0,10) << endl;
	}
}

int solve(int now, int sum, int b1){
	if(now == n){
		if(sum == s){return 1;}
		else return 0;
	}
	if(dp[now][sum][b1] != -1){return dp[now][sum][b1];}
	int t = 0;
	for(int i = 0; i < 10; i++){
		if(b1 != 10 && b1 >= i){continue;}
		t += solve(now+1, sum + i, i);
	}
	return dp[now][sum][b1] = t;
}