Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

C++: #include<stdio.h>
#include<math.h>

int main()
{
	int n, a, b, c, d, cnt = 0;
	while (scanf("%d", &n) != EOF)
	{
		cnt = 0;
		if (n > 36)
		{
			printf("0\n");
			continue;
		}
		for (a = 0; a < 10; a++)
		{
			if (n - a>27)continue;
			for (b = a; b < 10; b++)
			{
				if (n - a - b > 18)continue;
				for (c = b; c < 10; c++)
				{
					if (n - a - b - c > 9)continue;
					for (d = c; d < 10; d++)
					{
						if (a + b + c + d == n)
						{
							if ((a == b) && (a == c) && (a == d))cnt++;
							else if (((a == b) && (b == c)) | ((b == c) && (c == d)))cnt += 4;
							else if ((a == b) | (b == c) | (c == d))cnt += 12;
							else cnt += 24;
						}
					}
				}
			}
		}

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

C++: #include<iostream>
#include<cstdio>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
using namespace std;

int main(){
	int n;
	while(scanf("%d",&n)==1){
	int tot = 0;
	for(int i=0;i<10;++i){
		for(int j=0;j<10;j++){
			for(int k=0;k<10;++k){
				for(int w=0;w<10;++w){
					if(i+j+k+w==n){
						++tot;
					}
				}
			}
		}
	}
	cout<<tot<<endl;
	}
	return 0;
}

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

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

C++: #include<iostream>
using namespace std;
#define rep(i,n) for(i = 0;i < n;i++)
int main(){
	int n,i,j,k,l;
	int count[200] = {0},cor = 0;
	while(cin >> n){
		rep(i,10){
			rep(j,10){
				rep(k,10){
					rep(l,10){
						if(n == i+j+k+l)
							count[cor]++;
					}
				}
			}
		}
		cor++;
	}
	rep(i,cor){
		cout << count[i] << endl;
	}
	return 0;
}

C++: #include <iostream>
int main()
{
  int n;
  while (std::cin >> n) {
    int r = 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) {
              r++;
            }
          }
        }
      }
    }
    std::cout << r << std::endl;
  }
}

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

using namespace std;

#define llong long long 
int n;
int ans;
bool memo[1001];

void solve(int num, int sum, int d){
	if(d == 4){
		if(sum == num){
			ans++;			
		}
		return;
	}

	if(num < sum) return;

	for(int i = 0;i <= 9; i++){
		solve(num, sum + i, d + 1);
	}
	return;
}

int main(){
	while(cin >> n, n != EOF){
		ans = 0;
		solve(n, 0, 0);
		cout << ans << endl;
	}

	return 0;
}

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

C++: #include <iostream>

auto main () -> int
{
    int n;
    while (std::cin >> n)
    {
        int res = 0;
        for (auto a = 0; a < 10; ++ a)
        {
            for (auto b = 0; b < 10; ++ b)
            {
                for (auto c = 0; c < 10; ++ c)
                {
                    auto d = n - a - b - c;
                    if (0 <= d && d < 10)
                    {
                        ++ res;
                    }
                }
            }
        }
        std::cout << res << std::endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans=0;
	cin>>n;
	for(a=0;a<min(10,n);a++){
		k = n-a;
		for(b=0;b<min(10,k);b++){
			l = k-b;
			for(c=0;c<min(10,l);c++){
				m = l-c;
				if(0 <= m && m<10){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

C++: #include <stdio.h>

using namespace std;


int main(){
	int n,count;
	while(scanf("%d",&n)!=EOF){
		if(n >= 37){
			printf("0\n");
		}else{
			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++;
						}
					}
				}
			}
			printf("%d\n",count);
		}
	}

    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int a, b, c, d;
	int n = 0;

	while(cin >> n){

	int 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 = count +1;
					}
				}
			}
		}
	}

	cout << count << endl;
}
}

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

/*
inline int factorial(int n)
{
    int x = 1;
    for (;n != 0; n--)
        x *= n;
    return x;
}

inline int factorial(int s, int n)
{
    int x = 1;
    for (;n > s; n--)
        x *= n;
    return x;
}

inline int conbination(int n, int r)
{
    return factorial(n - r, n) / factorial(r);
}

inline int homogeneous(int n, int r)
{
    return conbination(n + r - 1, r);
}
*/

int calc(int n, int k)
{
    int count = 0;

    if (k == 0)
        if (n == 0)
            return 1;
        else
            return 0;

    for (int i = 0; i <= 9; i++) {
        int tmp = n - i;
        if (tmp < 0)
            break;
        else
            count += calc(tmp, k - 1);
    }

    return count;
}

int main()
{
    for (int n; cin >> n;)
        cout << calc(n, 4) << endl;

    return 0;
}

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

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

constexpr int n_ints = 4;
constexpr int min_int = 0;
constexpr int max_int = 9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, res;

    while (true) {
        cin >> n;
        if (cin.eof()) { break; }

        res = 0;
        FOR(a,min_int,max_int+1)
        FOR(b,min_int,max_int+1)
        FOR(c,min_int,max_int+1)
        FOR(d,min_int,max_int+1) {
            int sum = a + b + c + d;
            if (sum == n) {
                ++res;
            }
        }
        cout << res << endl;
    }

    return 0;
}

C++: include <iostream>

using namespace std;


int main()
{

	int n,count;
	int a,b, c,d;
	while(cin >> n){

		//a>=b>=c>=dと仮定
		count = 0;
		for( a = 0; a < 10; a++ ) {
			if ( a > n ) 
				continue;
			for( b = 0; b < a+1; b++ ) {
				if( a + b > n )
					continue;
				for( c = 0; c < b+1; c++ ) {
					if( a + b + c > n ) 
						continue;
					d = n - a - b- c;
					if( d > c )
						continue;
				if( a == d )//全部同じ
					count += 1;
				else if( a == c || b == d)//１つ異なる
					count += 4;
				else if( a == b && c == d )//2つずつ同じ
					count += 6;
				else if( a == b || b == c || c == d )//2つ同じ
					count += 12;
				else
					count += 24;
				}
			}
		}
		cout << count << endl;

	}

	return 0;
}