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;
while(cin>>n){
int res=0;
for(int n1=0;n1<=9;n1++)
for(int n2=0;n2<=9;n2++)
for(int n3=0;n3<=9;n3++)
for(int n4=0;n4<=9;n4++)
if(n1+n2+n3+n4==n) res++;
cout<<res<<endl;
}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

int main() {
	int n;
	while (cin >> n) {
		int cnt = 0;
		rep(a, 10)rep(b, 10)rep(c, 10)rep(d, 10) {
			if (a + b + c + d == n)cnt++;
		}
		cout << cnt << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int n,cnt;
void sach(int x,int sum){
  if(x==4){
    if(sum==n) cnt++;
    return;
  }
  for(int i=0;i<10;++i) sach(x+1,sum+i);
}
int main(){
  while(cin>>n){
    cnt=0;
    sach(0,0);
    cout<<cnt<<endl;
  }
  return 0;
}

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

int main(){
	int num, cou = 0;
	cin >>num;
	
	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) == num) cou++;
				}
			}
		}
	}
	
	cout <<cou<<endl;
	return 0;
}

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

int main() {
	int n, t = 0;
	cin >> n;
	for(int i = 1;i < 10;++i){
     	for(int o = 1;o < 10;++o){
     		for(int p = 1;p < 10;++p){
     		   for(int l = 1;l < 10;++l){
     		   	 if(i + o + p + l == n)
     		   	   t++;
     		   }
     		}
     	    }
	}
	cout << t << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n, a, b, c, d, count,p[1000],l=0;
	while (cin >> n){
		count=0;
		for (a = 0; a < 10; a++){
			if (n - a >= 27){
				for (b = 0; b < 18; b++){
					if (n - a - b >= 18){
						for (c = 0; c < 9; c++){
							if (n - a - b - c >= 9){
								for (d = 0; d < 9; d++){
									if (n - a - b - c - d == 0)
										count++;
								}
							}
						}
					}
				}
			}
		}
		p[l] = count;
		l++;
	}
	for (int m = 0; m < l; m++)
		cout << p[m] << endl;
}

C++: #include <iostream>

using namespace std;

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

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

int dfs(int n, int cnt) {
    if (n == 0) return 1;
    if (cnt == 4) return 0;

    int ret = 0;
    for (int i = 0; i < 10; i++) {
        ret += dfs(n-i, cnt+1);
    }

    return ret;
}

int main(void) {
    int n;
    while (cin >> n) {
        int ret = dfs(n, 0);
        cout << ret << endl;
    }

    return 0;
}

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



int main() {
	int a, b, c, d, n;
	int ans = 0;
	while (cin >> n) {
		
		for (a = 0; a <= 9; a = a + 1) {
			for (b = 0; b <= 9; b = b + 1) {
				for (c = 0; c <= 9; c = c + 1) {
					for (d = 0; d <= 9; d = d + 1) {
						if (a + b + c + d == n) {
							ans = ans + 1;
						}
					}
				}
			}
		}
	}
	cout << ans << '\n';
	return 0;
}

C++: //
//  main.cpp
//  CppTest
//
//  Created by Ryu on 2017/02/08.
//  Copyright ?? 2017??´ Ryu. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n[50];
    int comb[50];
    int m = 0;
    while (cin >> n[m]) {
        comb[m] = 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[m]) {
                            comb[m]++;
                        }
                    }
                }
            }
        }
        m++;
    }
    
    for (int i = 0; i < m; i++) {
        printf("%d\n", comb[i]);
    }
    printf("\n");
    
    return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int n;
	while(cin >> n)
	{
		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 == n)
						{
							++ans;
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007

using namespace std;

int main(void) {
	int n;
	int count = 0;

	while (cin >> n) {
		FOR(i, 0, 9) {
			FOR(t, 0, 9) {
				FOR(s, 0, 9) {
					FOR(u, 0, 9) {
						if (i + t + s + u == n) {
							count++;
						}
					}
				}
			}
		}
		cout << count << endl;
		count = 0;
	}
	
	return 0;
}

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

int main(void)
{
    int n = 0;
    
    while(cin >> n){
        int ans = 0;
        if(n >= 37){
            cout << ans << endl;
            continue;
        }

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

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

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

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;


int main()
{
	int count = 0, num;

	

	while (cin >> num)
	{
		num = 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 == num)
							count++;
					}
				}
			}
		}
		cout << count << endl;
	}

	

}