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++: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var str = Console.ReadLine();
                if (string.IsNullOrEmpty(str)) return;
                Console.WriteLine(pattern(int.Parse(str)));
            }
        }

        static int pattern(int n)
        {
            int ret = 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)
                                ret++;
                        }
                    }
                }
            }
            return ret;
        }
    }
}

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

int combination(int num) {
    int ret = 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 == num) ret++;
                }
            }
        }
    }
    return(ret);
}

int main(void) {
    int num;
    while(cin >> num) cout << combination(num) << endl;
    return(0);
}

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

using namespace std;

int calc(int, int, int);

int for2(int x,int i,int count,int sum){
	return x == -1 ?0 : calc(i, count - 1, sum + x) + for2(x - 1, i, count, sum);
}

int calc(int i, int count,int sum){
	return count == 0 ? sum == i : for2(9, i, count, sum);
}

int main(){
	int i;
	while (cin >> i){
		cout << calc(i, 4, 0) << endl;
	}
	return 0;
}

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());
        s.clear();
    }
}

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

int main()
{
	int n,a,b,cnt=0;
	cin >> n;
	for(a=0;a<=18;a++){
		for(b=0;b<=18;b++){
			if(a+b==n) cnt+= (10-(int)abs(a-9)) * (10-(int)abs(b-9));
		}
	}
	cout << cnt << endl;
	return 0;	
}

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

int main(){

	int n;
	int a, b, c, d;
	int combsum=0;
	cin >> n;

	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 )
						combsum++;

	cout << combsum << endl;
	return 0;
}

C++: #include<iostream>
int n, count = 0;

void f(int, int, int, int);
int main()
{
	std::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++)
					f(a, b, c, d);

	std::cout << count<< std::endl;
	return 0;
}

void f(int a, int b, int c, int d)
{
	if (a + b + c + d == n)
	{
		count++;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,n,N,Na,x,i,sum;
	while(scanf("%d",&n)!=EOF){
	sum=0;
		for(i=0;i<4;i++){
			N=n/4;
			Na=n%4;
			a=N;
			b=N;
			c=N;
			d=N+Na;
			x=a+b+c+d;
			if(x==n){
				sum++;
			}
		}
		printf("%d\n",sum);
	}
	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;
            	count = 0;
        }
	return 0;
}

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

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

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

C++: #include<iostream>

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

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

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