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;
  int a, b, c, d;
  int sum=0;
  int max=9;
  int count;
  while (1) {
    cin >> n;
    if (cin.eof()) break;
    count = 0;
    for (a=0; a<10; a++) {
      if (a > n) break;
      for (b=0; b<10; b++) {
        sum=a+b;
        if (sum > n) break;
        if (n-sum > 2*max) continue;
        for (c=0; c<10; c++) {
          sum = a+b+c;
          if (sum > n) break;
          if (n-sum > max) continue;
          count++;
        }
      }
    }
    cout << count << endl;
  }
}

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

int main() {
	int n;
	while(cin >> n) {
		int ans=0;
		for(int i=0; i<=9; i++) {
			for(int j=0; j<=9; j++) {
				for(int l=0; l<=9; l++) {
					if(n-(i+j+l) <= 9 && n-(i+j+l) >= 0) ans++;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: 
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii; 
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()

int main(void){
  int n ; 
  while(cin >> n){
    int cnt = 0;
    rep(i,10)
      rep(j,10)
      rep(k,10)
      rep(l,10)
      if(i+j+k+l==n){
	cnt++;
	//	cout<< i << " " << j << " " << k << " " << l << endl;
	cout<< cnt << endl;
      }
    cout<< cnt << endl;
  }
}

C++: #include <map>
#include <string>
#include <iostream>
#include<vector>
#include <set>
#include<algorithm>

using namespace std;

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

C++: #include <iostream>

using namespace std;

int main(void){
  for(int n, count = 0; cin >> n; cout << count << endl, count = 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 ++;

  return 0;
}

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

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

                cout << count << "\n";
        }

        return 0;
}

C++: #include<iostream>
int t[37],i,j,x,a,b;int main(){for(;i++<10000;t[x]++)for(j=x=0,b=i;j++<4;b/=10)x+=b%10;for(;!(std::cin>>a).eof();)printf("%d\n",t[a]);}

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

int n[50];

int main(){
    int input = 0;
    while(cin >> n[input]){
        input++;
    }
    for(int h = 0; h <= input; h ++){
        int c = 0;
        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < 10; j++)
            {
                for (int k = 0; k < 10; k++)
                {
                    if (n[h] - (i + j + k) >= 0 && n[h] - (i + j + k) < 10)
                        c++;
                }
            }
        }
        cout << c << endl;
    }
    return 0;
}

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

C++: #include<iostream>
using namespace std;
int main()
{
	int n,sum,i,j,k;
	while(cin>>n)
	{
		sum = 0;
		for(i = 0;i < 10;i++)
		{
			for(j = 0;j < 10;j++)
			{
				if((n-i-j < 19)&&(n-i-j > -1))
				{
					for(k = 0;k < 10;k++)
					{
						if((n-i-j-k >-1)&&(n-i-j-k)<10)
						{
							sum++;
						}
					}
				} 
			}
		}
		cout<<sum<<endl;
	}
	return 0;
}

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

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

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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;

#define REP(i, a, n) for(ll i = a; i < (ll)n; i++)
#define RREP(i, a, n) for(ll i = n-1; i >= (ll)a; i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007

template<class T> T read(){T a;cin >> a;return a;}
template<class T> void read(T& a){cin >> a;}
template<class T, class ...Args> void read(T& a, Args&... args){cin >> a; read(args...);} 
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<char c = ' ',class T> void write(T a){cout << fixed << setprecision(4) << a << endl;}
template<char c = ' ',class T,class ...Args> void write(T a, Args... args){cout << fixed << setprecision(4) << a << c; write<c>(args...);}
template<class T> void warr(vector<T> a, const char* c = " "){cout << a[0];for(int i = 1; i < (int)a.size(); i++)cout << c << a[i];cout << endl;;}
template<class T> void warr(T a, int n, const char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ull gcd(ull a, ull b){while(true){ull k = a % b;if(k == 0)return b;a = b;b = k;}}
ull comb(ull n, ull m){ull p=1;m=min(m,n-m);for(ull i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}

int main(void)
{
    int dp[5][100]={0};
    dp[0][0]=1;
    rep(i,4){
        rep(j,10){
            rrep(k,55){
                dp[i+1][k+j]+=dp[i][k];
            }
        }
    }
    while(!cin.eof()){
        int n;
        cin>>n;
        if(n==0)break;
        write(dp[4][n]);
    }
    return 0;
}

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

int main() {
    int n;

    while(cin >> n) {
        int count = 0;
        for (int i = 0; i <= 9; ++i) {
            if ((n - i) / 3.0 > 9) continue;
            if ((n - i) < 0) continue;
            for (int j = 0; j <= 9; ++j) {
                if ((n - (i+j)) / 2.0 > 9) continue;
                if ((n - (i+j)) < 0) continue;
                for (int k = 0; k <= 9; ++k) {
                    if ((n - (i+j+k)) > 9) continue;
                    if ((n - (i+j+k)) < 0) continue;
                    count++;
                }
            }
        }
        cout << count << endl;
    }

    return 0;
}