Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		if inputCount == 50 {
			break
		}
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
		count = 0
	}
	for _, v := range resultArr {
		fmt.Printf("%d\n", v)
	}
}

func calcA(input int) int {
	for i := 0; i <= 9; i++ {
		calcB(input, i)
	}
	return count
}

func calcB(input, a int) {
	for i := 0; i <= 9; i++ {
		calcC(input, a, i)
	}
}

func calcC(input, a, b int) {
	for i := 0; i <= 9; i++ {
		calcD(input, a, b, i)
	}
}

func calcD(input, a, b, c int) {
	for i := 0; i <= 9; i++ {
		if a+b+c+i == input {
			count++
		}
	}
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
  int n, sum, count;

  while(cin >> n) {
    count = 0;
    FOR(a, 0, 10) {
      FOR(b, 0, 10) {
	FOR(c, 0, 10) {
	  FOR(d, 0, 10) {
	    sum = a+b+c+d;
	    if(sum == n)count++;
	  }
	}
      }
    }
    cout << count << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main(){

	int a, b, c, d;
	int n;
	int count;

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

	cout << count <<endl;
}
}

C++: #include <cstdio>
#define rep(i,n) for(int i=0;i<=n;++i)
int main(){int r,n;while(scanf("%d",&n)!=EOF){r=0;rep(a,9)rep(b,9)rep(c,9)rep(d,9)if(a+b+c+d==n)r++;printf("%d\n",r);}}

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

int main()
{
	int n = 0;
	int answer = 0;
	int upper =10;
	cin >> n;

	for(int i = 0; i < upper; ++i)
	{
		for(int j = 0; j < upper; ++j)
		{
			for(int k = 0; k < upper;++k)
			{
				for(int l = 0; l < upper; ++l)
				{
					if((i+j+k+l)==n)
					{
						answer++;
					}
				}
			}
		}
	}

	cout << answer << endl;

	return 0;
}

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

int main()
{
	int n;
	while(cin >> n)
	{
		if(n > 36)
		{
			cout << 0 << endl;
			continue;
		}

		int max = (n < 9) ? n : 9;

		int found = 0;
		for(int a = 0; a <= max; a++)
			for(int b = 0; b <= max; b++)
				for(int c = 0; c <= max; c++)
					for(int d = 0; d <= max; d++)
						if(a + b + c + d == n)
							found++;

		cout << found << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;
 
bool binary_search(vector<int> a, int x){
    int left = 0, right = a.size() - 1;
 
    while (left <= right){
        int mid = (left + right) / 2;
        if (a[mid] == x) return true;
        else if (a[mid] < x) left = mid + 1;
        else right = mid - 1;
    }
    return false;
}
 
int main()
{
    vector<int> vec(19);
    int cnt = 0;
    for (auto& x : vec) x = cnt++;
    int n;
    cnt = 0;
    while (cin >> n){
        for (int i = 0; i < 10; i++){
            for (int j = 0; j < 10; j++){
                if (binary_search(vec, n - i - j)){
                    if (n - i - j == 0 || n - i - j == 18) cnt++;
                    else cnt += 2;
                    //cout << "i:" << i << " j:" << j << "k + l:" << n - i - j << endl;
                }
            }
        }
        cout << cnt << endl;
        cnt = 0;
    }
}

C++: #include<iostream>
using namespace std;
#define RENT 100000
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;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
	while(cin >> n) {
		int ret = 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) ret++;
					}
				}
			}
		}
		cout << ret << endl;
	}
	return 0;
}

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 = 0; j < 10; j++){
                for(int k = 0; k < 10; k++){
                    for(int l = 0; l < 10; l++){
                        if(i + j + k + l == n)  x++;
                    }
                }
            }
        }
        cout << x << endl;
    }
    
    return 0;
}

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

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

C++: #include <iostream>
using namespace std;
 
int solve(int N){
    int ans = 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){
                    int tmp = i + j + k + l;
                    if(tmp == N) ans++;
                }
            }
        }
    }
    return ans;
}
 
int main(){
    int N;
    while(cin >> N){
        int ans = solve(N);
        cout << ans << endl;
    }
}

C++: #include <iostream>
using namespace std;
int ary[60],res[40];
int main(){
	int N;
	for(int i=1;i<=51;i++){
		cin>>ary[i];
		if(cin.eof()){
			N=i-1;
			break;
		}
	}
	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++){
					res[i+j+k+l]++;
				}
			}
		}
	}
	for(int i=1;i<=N;i++){
		if(ary[i]>=0&&ary[i]<=36)cout<<res[ary[i]]<<endl;
		else cout<<0<<endl;
	}
	return 0;
}

C++: #include<iostream>

int main(){
	int n;
	int count = 0;
	while (std::cin >> n){
		count = 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){
						if (a + b + c >= n - 9 && a + b + c <= n)++count;
					}
				}
			}
		}
		std::cout << count << std::endl;
	}
	return 0;
}