Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		count := 0
		for i := 9; i >= 0; i-- {
			numCpy, _ := strconv.Atoi(scanner.Text())
			if numCpy-i >= 0 {
				for j := 9; j >= 0; j-- {
					numCpyi := numCpy - i
					if numCpyi-j >= 0 {
						for k := 9; k >= 0; k-- {
							numCpyj := numCpyi - j
							if numCpyj-k >= 0 {
								for l := 9; l >= 0; l-- {
									numCpyk := numCpyj - k
									if numCpyk-l == 0 {
										count++
										break
									}
								}
							}
						}
					}
				}
			}
		}
		fmt.Println(count)
	}

}

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

C++: #include<iostream>
using namespace std;
int main(){
	int n, i, j, k, l, C = 0;
	while (cin >> n;){
		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++;
						}
					}
				}
			}
		}
	}
	cout << C << 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 i=0; i<10; i++) {
            for (int j=0; j<10; j++) {
                for (int k=0; k<10; k++) {
                    int d = n-i-j-k;
                    if (0 <= d && d < 10) {
                        count++;
                    }
                }
            }
        }
        cout << count << endl;
    }
}

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

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
    int n, a, b, c, d;
	
	while(cin >> n){
		int count = 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){
							count++;
						}else if(i+j+k+l>n){
							break;
						}
					}
				*/
				if(n-(i+j+k)>=0 && n-(i+j+k)<10)
					count++;
				}
			}
		}
		cout << count <<endl;
	}
	
	return 0;
}

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

bool listen_input(int &inputNum)
{
	using namespace std;
	
	cin>>inputNum;
	if(cin.eof())
	{
		return false;
	}
	else
	{
		return true;
	}
}

class Sums//コンストラクタで全10000通りの和を格納、count_~の呼び出しでこれらを数え上げる
{
private:
	int sum[10000];
	void calc_increase(int []);
	void increase_eachDigit(const int,int[]);
public:
	Sums();
	int count_combination(const int);
};

Sums::Sums()
{
	int nums[5]={};
	int tmp_sum=0;
	
	sum[0]=0;//(a,b,c,d)=(0,0,0,0)
	for(int roop=1;1;roop++)
	{
		calc_increase(nums);//(a,b,c,d)=(1,0,0,0)から全解探索
		if(nums[4])
		{
			break;
		}
		
		tmp_sum=0;
		for(int roop_sum=0;roop_sum<4;roop_sum++)
		{
			tmp_sum+=nums[roop_sum];
		}
		sum[roop]=tmp_sum;
	}
	
	std::sort(sum,sum+10000);
}

void Sums::calc_increase(int nums[])
{
	nums[0]++;
	for(int roop=0;roop<4;roop++)
	{
		increase_eachDigit(roop,nums);
	}
}

void Sums::increase_eachDigit(int digitNum,int nums[])
{
	if(nums[digitNum]==10)
	{
		nums[digitNum]=0;
		nums[digitNum+1]++;
	}
}

int Sums::count_combination(const int inputNum)
{
	int count=0;
	
	for(int roop=0;roop<10000;roop++)
	{
		if(sum[roop]==inputNum)
		{
			count++;
		}
		else if(sum[roop]>inputNum)
		{
			break;
		}
	}
	
	return count;
}

int main()
{
	Sums inst_sum;
	
	int inputNum;
	while(listen_input(inputNum))
	{
		std::cout<<inst_sum.count_combination(inputNum)<<std::endl;
	}
	
	return 0;
}

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

int main(){
	int a, b, c, d, e=0, n;
	while (cin >> n){
		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)e++;
					}
				}
			}
		}
		cout << e << '\n';
		e = 0;
	}
	return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int n;
    while(cin >> n) {
        int res = 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) {
                        res += a+b+c+d == n;
                    }
                }
            }
        }
        cout << res << endl;
    }
}

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

int main(){
	int n, ans;

	while(cin >> n){
		ans = 0;

		if(n <= 36){
			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 << endl;
	}
}

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

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

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

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

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

	return 0;
}

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

int main(){
	int a,b,c,d,n;
	int num=0;
	
	while(cin >> n){
	
	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)	num++;
				}
			}
		}
	}
	cout << num << endl;
	num = 0;
	}

}

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

int _abs (int n) { return n<0?-n:n; }
int main () {
	int i,n,d,a,T[20]={1},S[10]={4};
	for (i=1;i<20;++i) T[i]=T[i-1]+(i+1)*T[0];
	for (i=1;i<10;++i) S[i]=S[i-1]+(i+1)*S[0];
	while (cin>>n) {
		d=18-_abs(n-18);a=0;
		if (0<=d&&d<=18) {
			for (i=d+1;i--;) a+=T[i];
			if (d>9) for (i=d-9;i--;) a-=S[i];
		}
		cout << a << endl;
	}
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){
    
    int n;
    while(cin>>n){
        int ans=0;
        rep(i,10){
            rep(j,10){
                rep(k,10){
                    rep(l,10){
                        if(i+j+k+l==n){
                            ans++;
                        }
                    }
                }
            }
        }
        
        
        cout<<ans<<endl;
        
        
        
    }
    
    return 0;
}

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

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

	return(0);
}