Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(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;
}

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

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

int num ;
int count = 0 ;

int main()
{
	cin >> num ;

	if( num <= 36 )
	{
		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) == num )
						{
							count ++ ;
						}
					}
				}
			}
		}
	}

	cout << count ;

	return 0 ;
}

C++: #include <iostream>

using namespace std;

int main()
{
	while (1)
	{
		int n;
		cin >> n;
		if (cin.fail()) break;

		int count = 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)
						{
							++count;
						}
					}
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}

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

int main(){
	int n;
	while(cin >> n){
		if(n>36 || n<4)
			cout << 0 << endl;
		int cnt = 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)
                    		cnt++;
                	}
            	}
        	}
    	}
		cout << cnt << endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main()
{
	int n;
	
	while ( scanf ("%d", &n) != EOF)
	{
		int count = 0;
		
		for (int i = 1; i <= 9; i++)
			for (int j = 1; j <= 9; j++)
				for (int k = 1; k <= 9 ; k++)
					for (int l = 1; l <= 9; l++)
						if ( (i + j + k + l) == n)
							count ++;
							
		printf ("%d\n", count);
	}

        return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int sum = 0;
    int cnt = 0;
    for (int a = 0; a < 10; ++a) {
    sum += a;
    for (int b = 0; b < 10; ++b) {
    sum += b;
    for (int c = 0; c < 10; ++c) {
    sum += c;
    for (int d = 0; d < 10; ++d) {
    sum += d;
    if (sum == n) cnt++;
    }
    }
    }
    }
    cout << cnt << endl;
  }
  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;
	return 0;
}