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,cnt = 0;
  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)cnt++;
	}
      }
    }
  }
  cout << cnt << endl;
}

C++: #include <cstdio>
#include <set>
#include <tuple>

struct C { int a, b, c, d; };

int main() {
    int n;
    std::set<std::tuple<int, int, int, int>> s;
    while (~scanf("%d", &n)) {
        for (int a = 0; a < 10 && a <= n; ++a) {
            for (int b = 0; b < 10 && a + b <= n; ++b) {
                for (int c = 0; c < 10 && a + b + c <= n; ++c) {
                    for (int d = 0; d < 10 && a + b + c + d <= n; ++d) {
                        if (a + b + c + d == n) {
                            s.insert(std::make_tuple(a, b, c, d));
                        }
                    }
                }
            }
        }
    }
    printf("%lu\n", s.size());
}

C++: #include<cstdio>
int main(void){
	int n;
	int a,b;
	int s;
	while (scanf("%d", &n) != EOF){
		s = 0;
		for (int i = 0; i < 19; i++){
			if (n - 18 <= i&&i <= n){
				if (i < 9)a = i + 1;
				else a = 19 - i;
				if (n < i + 9)b = n - i + 1;
				else b = 19 + i - n;
				s = (a*b) + s;
			}
		}
		printf("%d\n", s);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
	while(cin >> n) {
		int ret = 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) ret++;
					}
				}
			}
		}
		cout << ret << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int a, b, c, d, n;
	int x = 0;
	
	while(cin >> n){
		for(int i = 1;i <10;i++){
			for(int j = 1; j < 10; j++){
				for(int k = 1; k < 10; k++){
					for(int l = 1; l < 10; l++){
						if(i + j + k + l == n){
							x++;
						}
					}
				}
			}
		}
		cout << x << endl;
	}
	
	return 0;
}

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

int main(){
int n;
while(~scanf("%d",&n)){
int res = 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) res++;
}

printf("%d\n",res);
}

C++: #include <iostream>

using namespace std;

int main() {
    int n;
    while (!cin.eof()) {
        int count = 0;
        cin >> n;
        for (int i=0; i<10; i++) {
            for (int j=0; j<10; j++) {
                for (int k=0; k<10; k++) {
                    int d = n-i-j-k;
                    if (0 <= d && d < 10) {
                        count++;
                    }
                }
            }
        }
        cout << count << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<memory.h>
#include<string>
using namespace std;

int DP[10][100];
int N;

int main()
{
	while(scanf("%d",&N)!=EOF)
	{
		memset(DP,0,sizeof(DP));
		DP[0][0]=1;
		for(int i= 0;i<=4;i++)
		{
			for(int j=0;j<=N;j++)
			{
				for(int k=0;k<10;k++)
				{
					DP[i+1][j+k]+=DP[i][j];
				}
			}
		}
		printf("%d\n",DP[4][N]);
	}

}

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

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

struct dat
{
	int n;
	int p;

	dat(int n, int p)
	{
		this->n = n;
		this->p = p;
	}
};

int binary_search(int x, vector<dat> &d)
{
	int l = 0;
	int r = d.size();

	int c = 0;

	for (; r > l;)
	{
		int i = (l + r) / 2;
		if (d.at(i).n == x)
		{
			return d.at(i).p;
		}
		else if (d.at(i).n < x)
		{
			l = i + 1;
		}
		else
		{
			r = i;
		}
	}

	return 0;
}

int main()
{
	int n;
	for (; cin >> n;)
	{
		int count = 0;
		vector<int> a;
		
		for (int i = 0; i <= 9; i++)
		{
			for (int j = 0; j <= 9; j++)
			{
				a.push_back(i + j);
			}
		}

		sort(a.begin(), a.end());

		int old = a.at(0);
		int p = 1;
		vector<dat> d;
		for (int i = 1; i < a.size(); i++)
		{
			if (old == a.at(i))
			{
				p++;
			}
			else
			{
				d.push_back(dat(old, p));
				p = 1;
			}

			old = a.at(i);
		}

		d.push_back(dat(old, p));

		for (int i = 0; i <= 9; i++)
		{
			for (int j = 0; j <= 9; j++)
			{
				count += binary_search(n - i - j, d);
			}
		}
		
		cout << count << endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(void) {
  int n = 0;
  cin >> n;

  int 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 == n) num++;
        }
      }
    }
  }

  cout << num << '\n';

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);

int main(void){
	int dp[4][40];
	fill_n(*dp, 4*40, 0);
	rep(i, 10)dp[0][i] = 1;
	for(int i = 1; i <= 3; i++){
		for(int j = 36; j >= 0; j--){
			for(int k = 0; k <= 9; k++){
				if(j-k < 0)break;
				dp[i][j] += dp[i-1][j-k];
			}
		}
	}
	int n;
	while(cin >> n)
		FIN(dp[3][n]);

	return 0;
}

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

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

C++: #include<iostream>

int main(){

  int n,k;

  while(std::cin >> n){
    k=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){
              ++k;
            }
          }
        }
      }
    }
    std::cout << k << std::endl;
  }
}

C++: #include <iostream>
using namespace std;
int main()
{
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;
}
return 0;
}

C++: #include<iostream>
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<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pb push_back

# define inOut(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
# define RESET(a) memset(a,0,sizeof(a))
# define MEMO(a) memset(a,-1,sizeof(a))
# define DEBUG puts("Debug-Has-Come-Until-Here")


typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

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

	return 0;
}