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>
#include<cmath>
using namespace std;

int main()
{
	int n,a,b,cnt=0;
	cin >> n;
	for(a=0;a<=18;a++){
		for(b=0;b<=18;b++){
			if(a+b==n) cnt+= (10-(int)abs(a-9)) * (10-(int)abs(b-9));
		}
	}
	cout << cnt << endl;
	return 0;	
}

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

int main(){

	int n;
	int a, b, c, d;
	int combsum=0;
	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 )
						combsum++;

	cout << combsum << endl;
	return 0;
}

C++: #include<iostream>
int n, count = 0;

void f(int, int, int, int);
int main()
{
	std::cin >> n;
	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++)
					f(a, b, c, d);

	std::cout << count<< std::endl;
	return 0;
}

void f(int a, int b, int c, int d)
{
	if (a + b + c + d == n)
	{
		count++;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,n,N,Na,x,i,sum;
	while(scanf("%d",&n)!=EOF){
	sum=0;
		for(i=0;i<4;i++){
			N=n/4;
			Na=n%4;
			a=N;
			b=N;
			c=N;
			d=N+Na;
			x=a+b+c+d;
			if(x==n){
				sum++;
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}

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

int main()
{
	int N;
	
	int count = 0;
	
	while(cin >> N)
	{
		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++)
					{
						int s = a + b + c + d;
						if(s == N)count++;
						else if(s > N)break;
					}
				}
			}
		}
                cout << count << endl;
            	count = 0;
        }
	return 0;
}

C++: #include<stdio.h>
int main(){
  int a,b,c,d,n,ans=0;
  while(scanf("%d",&n)!=EOF){
    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){
	      ans++;
	    }
	  }
	}
      }
    }
    printf("%d\n",ans);
    ans=0;
  }
  return(0);
}

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

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

C++: #include<iostream>

using namespace std;
   
void sumOfIntegers()
{
    int n;
    int 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<<endl;
    }
    
    return;
}
     
int main()
{     
    sumOfIntegers();
    return 0;
}

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

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

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0LL)
#define mapmin(v) v.rbegin()->first
#define mapmax(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK cerr<<"OK\n"
#define OK1 cerr<<"OK1\n"
#define OK2 cerr<<"OK2\n"
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n
#define endl '\n'

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);
const ll mod=1000000007;
const ll mod2=998244353;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

void YES(bool b) {cout << ((b)?"YES\n":"NO\n");}
void Yes(bool b) {cout << ((b)?"Yes\n":"No\n");}
void yes(bool b) {cout << ((b)?"yes\n":"no\n");}
void Yay(bool b) {cout << ((b)?"Yay!\n":":(\n");}

ll powmod(ll a,ll b){ll c=1; while(b>0){ if(b&1){ c=a*c%mod; } a=a*a%mod; b>>=1; } return c;}
ll nCrmod(ll n,ll r){ll x=1,y=1; rep(i,r){x=x*(n-i)%mod; y=y*(i+1)%mod;} return x*powmod(y,mod-2)%mod;}
ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n;
	while(cin >> n){
		ll cnt=0;
		rep(i,10)rep(j,10)rep(k,10)rep(l,10){
			if(i+j+k+l==n) cnt++;
		}
		cout << cnt << 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 < 10) cnt += n - i - j + 1;
					else cnt += 19 - n + i + j;
				}
			}
		}
		cout << cnt << "\n";
		cnt = 0;
	}
	cout.flush();
}

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

int main() {
  int a, b, c, d;
  int n;
  while (cin >> n) {
    int ans = 0;
    for (int a = 0; a <= 9; a++) {
      for (int b = 0; b <= 9; b++) {
        for (int c = 0; c <= 9; c++) {
          int tmp = n - (a + b + c);
          for (int d = 0; d <= 9; d++) {
            if (tmp == d) {
              ans++;
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
}