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 <iostream>
#include <vector>
#include <math.h>
#include <string>

int main(void);
int combination(int n);
bool combination_sub(int a, int b, int c, int d, int n);

int main(){
	int n;				//入力されるデータセット
	int cnt = 0;		//データセット入力カウント
	std::vector<int> result;		//組み合わせ個数を格納する配列

	while (std::cin >> n){
	//while (cnt < 2){
		//std::cin >> n;
		result[cnt] = combination(n);
		cnt++;
	}

	for (int i = 0; i < (sizeof(result) / sizeof(result[0])); i++){
		std::cout << result[i] << std::endl;
	}

	//while (1);
	return 0;
}

int combination(int n){
	int rtn = 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 (combination_sub(a, b, c, d, n)){
						rtn++;
					}
				}
			}
		}
	}

	return rtn;
}

bool combination_sub(int a, int b, int c, int d, int n){
	if ((a + b + c + d) == n){
		return true;
	}
	else{
		return false;
	}
}

C++: #include<cstdio>
int main(){
	int n;
	int i,j,k;
	while(scanf("%d",&n) != EOF){
		int counter = 0;
		for(i=0;i<=9;i++){
			for(j=0;j<=9;j++){
				for(k=0;k<=9;k++){
					if(n-(i+j+k) >= 0 && n-(i+j+k) <= 9){
						counter++;
					}
				}
			}
		}
		printf("%d\n",counter);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int sum2(int n, int total, int stage)
{
  int count = 0;

  if (stage == 4) {
    if (total == n) return 1;
    return 0;
  }

  if (total > n) return 0;

  for (int i = 0; i < 10; i++) {
    count += sum2(n, total + i, stage + 1);
  }

  return count;
}

int sum(int 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++;

  return count;
}

int main(void)
{
  int n;

  while (cin >> n) cout << sum2(n, 0, 0) << endl;

  return 0;
}

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

int partition(int s,int k,int n){
	if(s<0) return 0;
	if(s>9 && n==1) return 0;
	
	if((s>=0 && s<=min(9,s)) && n==1)return 1;
	int ret=0;
	int x=k;
	for(x=0;x<=min(9,s);x++){
		ret+=partition(s-x,x,n-1);
	}
	return ret;
}

int main(void){
int s;

//	for(s=1;s<=50;s++)cout<<s<<":"<<partition(s,0,4)<<endl;
	while(cin>>s && s!=EOF){
		if(s>18)s=36-s;
		cout<<partition(s,0,4)<<endl;
	}


return 0;
}

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

using namespace std;

int main()
{
	string str = "";

	while (getline (cin, str) ) {
		int n = 0;
		int res = 0;
		stringstream ss(str );
		ss >> n;

		for (int i = 0; i < 10000; ++i ){
			int a = i/1000;
			int b = (i/100) % 10;
			int c = (i/10) % 10;
			int d = i % 10;
			
			if (a + b + c + d == n ){
				++res;
			} // end if
		} // end for
		cout << res << endl;	
	} // end while

	return 0;
}

C++: #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(int& a){printf("%d",a);}
//void print(long long& a){printf("%lld",a);}
void print(double& a){printf("%.15lf",a);}
template<class T> void print(T& a){cout<<a;}
template<class T> void print(vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(Head& head, Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(T& a){cerr<<a;}
template<class T> void dprint(vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(Head& head, Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    int n,ans;
    while(scanf("%d",&n)!=EOF){
        ans=0;
        rep(i,10){
            rep(j,10){
                rep(k,10){
                    rep(l,10){
                        if(i+j+k+l==n)ans++;
                    }
                }
            }
        }
        out(ans);
    }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
#define int long long

signed main(){
        int a;
        while( scanf("%lld", &a) != 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(i+j+k+l==a) ans++;

                printf("%lld\n",ans);
        }
        return 0;
}

C++: #include<stdio.h>
int n;
int i,j,h,w,cnt=0;
int main(void){
	scanf("%d",&n);
	for(i=0;i<=9;i++){
		for(j=0;j<=9;j++){
			for(h=0;h<=9;h++){
				for(w=0;w<=9;w++){
					if(n==i+j+h+w){
						cnt++;
					}
				}
			}
		}
	}
	printf("%d\n",cnt);
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		int cnt = 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){
						cnt++;
					}
				}
			}
		}
	}
	cout << cnt <<endl;
	}
return 0;

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

int main(void){
  int n,m;
  m = 0;

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

  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		long long 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++;
		cout<<count<<endl;
	}
	getchar();
	getchar();
	return 0;
}