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(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	while(cin >> 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){
					if(i + j + k + l == n){
						ans++;
					}
				}
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
	}
}

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;
}