Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		if inputCount == 50 {
			break
		}
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
		count = 0
	}
	for _, v := range resultArr {
		fmt.Printf("%d\n", v)
	}
}

func calcA(input int) int {
	for i := 0; i <= 9; i++ {
		calcB(input, i)
	}
	return count
}

func calcB(input, a int) {
	for i := 0; i <= 9; i++ {
		calcC(input, a, i)
	}
}

func calcC(input, a, b int) {
	for i := 0; i <= 9; i++ {
		calcD(input, a, b, i)
	}
}

func calcD(input, a, b, c int) {
	for i := 0; i <= 9; i++ {
		if a+b+c+i == input {
			count++
		}
	}
}

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

int main () {
    int n, i,j,k,l,count=0;
    while(cin >> n) {
        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 == n) count++;
                    }
                }
            }
        }
    }
cout << n << endl;
}

C++: #include<iostream>
using namespace std;
int main()
{
int n,S;
int a[4];

while(cin>>n)
{
S=0;
a[0]=0;
a[1]=0;
a[2]=0;
a[3]=0;
for(int i=0;i<10;i++)
{
	a[0]=i;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	for(int j=0;j<10;j++)
{
	a[1]=j;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
for(int k=0;k<10;k++)
{
	a[2]=k;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
}
	for(int l=0;l<10;l++)
{
	a[3]=l;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
}
}	
}
}
cout<<S<<endl;	
}
return 0;
}

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

int main()
{
  int cou = 0;
  int n;
  while (scanf("%d", &n) != EOF){

    cin >> n;

    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){
              cou++;
            }
          }
        }
      }
    }
    
  cout << cou << "\n";
  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
	int a;
	while (cin>>a)
	{
		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 == a) ans++;
					}
			}
			}
		}
	}
	cout<<ans;
	return 0;
}

C++: #include <iostream>

using namespace std;

// naive but easy to implement
int calc(int 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++;
          }
        }
      } 
    }
  }

  return count;
}

int main(int argc, char const* argv[])
{
  int n;
  while (cin >> n) {
    cout << calc(n) << endl;
  };
  return 0;
}

C++: #include<stdio.h>

main(){int n,k,i,f;while(~scanf("%d",&n)){for(f=i=0;k=n-i/100-(i/10)%10-i%10,i<1000;++i)if(k<10&&k>=0)f++;printf("%d\n",f);}}

C++: #include <iostream>

using namespace std;

void compute(int n) 
{
  int num = 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)
            num++;
  cout << num << endl;
}


int main(void) 
{
  int n;
  while (cin >> n) {
    compute(n);
  }
  
  return 0;
}

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

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

C++: #include <iostream>

int main(){
	int n;
	
	while(std::cin >> n){
		int 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;
						}
					}
				}
			}
		}
		std::cout << count << std::endl;
	}
	
	return 0;
}

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

int main(){
	int i, j, k, l, n, count = 0;
	cin >> n;
	for(i = 0; i <= 9; i++){
		for(j = 0; j <= 9; j++){
			for(k = 0; k <= 9; k++){
				for(l = 0; l <= 9; l++){
					if(i + j + k + l == n){
						count ++;
					}
				}
			}
		}
	}
	cout << count << endl;

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a;
int main(){
	while(cin>>a){
		int sum=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==a){
							sum++;
						}
					}
				}
			}
		}
		cout<<sum<<endl;
	}
	return 0;
}

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

int main(){
	int s[60]={0};int n=0,cnt=0;
	while(cin>>s[n++]);n--;
	for(int i=0;i<n;i++){
		for(int a=0;a<10;a++){
			for(int b=0;b<10;b++){
				for(int c=0;c<10;c++){
					if(s[i]-a-b-c>-1&&s[i]-a-b-c<10)cnt++;
				}
			}
		}
		cout<<cnt<<endl;cnt=0;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define BOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

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

C++: #include<iostream>
#include<algorithm>

using namespace std;
int n;
int num[10];
int dx[3]={-1,0,1};
int sum;
int ans=0;

void init()
{
	for(int i=0;i<10;i++){
		num[i]=i;
	}
}

void dfs(int x)
{
	for(int i=1;i<3;i++){
		int nx=x+dx[i];
		if(1<=nx&&nx<10){
		//	cout<<nx<<endl;
			sum+=nx;
			if(sum==n){
				ans++;
			}else{
				if(sum>n) break;
			}
			dfs(nx);
			sum-=nx;
		}
	}
}

void solve()
{
	sum=0;
	for(int i=1;i<10;i++){
		sum+=i;
		dfs(i);
		sum-=i;
	}
}

int main()
{
	init();
	cin>>n;
	solve();
	cout<<ans<<endl;
	return 0; 
}

C++: #include <bits/stdc++.h>

const static double	de_PI	= 3.14159265358979323846;
const static int	de_MOD	= 1000000007;
const static int	de_MAX	= 999999999;
const static int	de_MIN = -999999999;

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0, ans = 0;
	std::vector<int> A;

	while (std::cin >> n) {
		A.push_back(n);
	}

	for (unsigned int x = 0; x < A.size(); x++) {
		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 == A[x]) {
							ans++;
						}
					}
				}
			}
		}
		std::cout << ans << std::endl;
	}

}