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 <bits/stdc++.h>


int main()
{
    int N, sum;

    while(std::scanf("%d", &N) != EOF) {
        if (N > 36) std::printf("%d\n", 0);
        else {
            sum = 0;
            for (int i = 0; i <=9; i++) {
                if (i > N) break;
                for (int j = 0; j <= 9; j++) {
                    if (i + j > N) break;
                    for (int k = 0; k <= 9; k++) {
                        if (i + j + k > N) break;
                        for (int l = 0; l <= 9; l++) {
                            if (i + j + k + l > N) break;
                            if (i + j + k + l == N) sum++;
                        }
                    }
                }
            }
            std::printf("%d\n", sum);
        }
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,ans=0;
	while(cin >> n){
	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;
	ans=0;
	}
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){
  int a,b,c,d,n,count = 0;
  while(scanf("%d",&n)!=EOF){
     
    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;

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

C++: #include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>


/*
	HOME-  Volume0-0008
	Submit Statistics
	 
	PCK 2003
	Sum of 4 Integers
	Time Limit : 1 sec, Memory Limit : 32768 KB
	English version is here

	Sum of 4 Integers

	50 ÈºÌ³Ì® n ðüÍµA0 ` 9 ÌÍÍÌ® a, b, c, d ÌgÅ

	        a + b + c + d = n

	ð½·àÌÌgÝí¹ðoÍ·évOðì¬µÄº³¢B

	á¦ÎAn ª 35 ÌÆ«A(a, b, c, d) Í (8,9,9,9)A(9,8,9,9)A(9,9,8,9)A(9,9,9,8) Ì 4 ÊèÅ·ÌÅA¦Í 4 ÆÈèÜ·B
	Input

	¡Ìf[^Zbgª^¦çêÜ·Bef[^ZbgÉ n ªPsÉ^¦çêÜ·BüÍÌÅãÜÅµÄº³¢B
	Output

	ef[^Zbg²ÆÉAa, b, c, d ÌgÝí¹ÂðPsÉoÍµÄº³¢B
	Sample Input

	35
	1

	Output for the Sample Input

	4
	4
*/

using namespace std;


int main()
{
	string s;
	
	while (getline(cin, s))
	{
		int n;
		sscanf(s.c_str(), "%ld", &n);
		
		int x = 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 (n == (a + b + c + d))
			{
				x++;
			}
		}
		
		printf("%d\n", x);
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int n, result = 0;

	while(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++) {
						if (n == a + b + c + d) result++;

					}	
				}	
			}
		}
		cout << result << endl;
	}

	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const double INF = 1e12;

LL gcd(LL a,LL b){
	if(b==0)return a;
	return gcd(b,a%b);
}

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

C++: #include <stdio.h>

int main(void)
{
	int n;
	int a,b,c,d;
	int count;
		
	scanf("%d", &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++;
					}
				}
			}
		}
	}
	
	printf("%d\n", count);
	
	return (0);
}

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

int main(){
	int ans,a,b,c,d,n;

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

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

int a,b,x;

int mySet(int d){
  for(int i=0;i<10;i++){
    if(d<3){
      mySet(d+1);
    }else if(d==3){
      if(a==x){
      b++;
      }
    }
    a++;
  }
  return a=a-10;
}

int main(void){
  cin>>x;
  mySet(0);
  cout<<b<<endl;
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>

using namespace std;

int hasil,input; 

int main()
{
	while(scanf("%d",&input) != EOF)
	{	
	hasil=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(input==a+b+c+d)
					{
						hasil++;
					}
				}
			}
		}
	}
	printf("%d\n",hasil);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
int n, ans;

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

C++: /*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0008&lang=jp*/

#include <iostream>

using namespace std;

int main(){
    int n;

    while(cin >> n) {
        int r = 0;
        for (int i = 0; i < n + 1 && i < 10; ++i) {
            for (int j = 0; i + j < n + 1 && j < 10; ++j) {
                for (int k = 0; i + j + k < n + 1 && k < 10; ++k) {
                    if (n < i + j + k + 10) {
                        r++;
                    }
                }
            }
        }
        cout << r << endl;
    }
    return 0;
}