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;
int main(){
    int n,i,j,k,l,count=0;
    while(cin>>n){
    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(n==i+j+k+l)count++;
                }
            }
        }
    }
    cout<<count<<endl;
        count=0;
    }
    return 0;
}

C++: /*-*-coding:utf-8-*-*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
  int n;
  
  while(cin >> n, !cin.eof()) {
    int ans = 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++) {
	    if(n == i + j + k + l) ans++;
	  }
	}
      }
    }
    cout << ans << endl;
  }

  return 0;
}

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

using namespace std;

int main(void){
  int n = 0;
  while(cin >> n){
    int num = 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++)
	  if(i+j+k+l == n)
	    num ++;
  cout << num << endl;
  }
  return 0;
}

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

int main(){
        int a,b,c,d,n;
        int count = 0;


        while(cin >> n){
                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;
        }
}

C++: #include<stdio.h>

int main(void)
{
	int i, j, k, l;
	int a, cont = 0;
	scanf("%d",&a);
	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){
						cont++;
					}
				}
			}
		}
	}
	printf("%d",cont);
	fflush(stdin);
	fflush(stdout);	
	return 0;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	int a,b,c,d,n;
	int num;
	/*****処理部*****/
	while(1){
		num = 0;
		cin >> n;
		for(a=0;a<=9;a++){
			for(b=0;b<=9;b++){
				for(c=0;c<=9;c++){
					d = n-a-b-c;
					if(d >= 0 && d <= 9){
						//cout << d << endl;
						num++;
					}
				}
			}
		}
		cout << num << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>


#pragma warning(disable:4996)
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
using namespace std;

int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };

int  dp[10000];

int main()
{
	REP(i, 10){
		REP(j, 10){
			REP(k, 10){
				REP(l, 10){
					dp[i * 1000 + j * 100 + k * 10 + l] = i + j + k + l;
				}
			}
		}
	}
	int n;
	while (cin >> n){
		cout << count_if(dp, dp + 10000, [n](int o){return o == n; }) << endl;
	}

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;

long long int gcd(long long int l, long long int r) {
	assert(l > 0 && r > 0);
	if (l > r)return gcd(r, l);
	else {
		const long long int num = r%l;
		if (num) {
			return gcd(l, num);
		}
		else {
			return l;
		}
	}
}
long long int lca(long long int l, long long int r) {
	return l / gcd(l, r)*r;
}
int getans(const int num, const int rest) {
	if (rest) {
		int ans = 0;
		for (int i = 0; i <= 9; ++i) {
			if (num >= i) {
				ans += getans(num - i, rest - 1);
			}
		}
		return ans;
	}
	else {
		return num == 0;
	}
}
int main() {
	int N;
	while (cin >> N) {
		cout << getans(N, 4) << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	while(true){
		int count = 0;
		cin >> n;
		if(cin.eof()) return 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) count++;
					}
				}
			}
		}
	cout << count << endl;
	}

	return 0;
}

C++: #include <cstdio>

int main(int argc, char const *argv[]){
//	freopen("in.txt", "r", stdin);

	int n;
	while(scanf("%d", &n) != EOF){
		if(n > 36){
			printf("0\n");
			continue;
		}
		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 ++;
		printf("%d\n", count);
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int n,t=0;
	cin>>n;
	if(n<=36){
	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){
						t++;
						
					}
					
					cout<<t<<endl;
	}
					return 0;
}