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++: #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;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  int n;
  while (cin >> n) {
    int ans = 0;
    repc(a, 9) repc(b, 9) repc(c, 9) repc(d, 9) {
      if (a + b + c + d == n) ans++;
    }
    cout << ans << '\n';
  }
}

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

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

C++: #include<iostream>
int t[37]={0},i,j,x,a,b;int main(){for(;i++<10000;t[x]++)for(j=x=0,b=i;j++<4;b/=10)x+=b%10;for(;!(std::cin>>a).eof();)printf("%d\n",t[a]);}

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

int main () {

int n, count = 0;

    cout << "Input n: ";
    cin >> n;

for (int a = 0; a < 10 && a <= n; a++){
    for (int b = 0; b < 10 && b <= n-a; b++){
        for (int c = 0; c < 10 && c <= n-a-b; c++){
            if (n-a-b-c >=0 && n-a-b-c < 10) {
                count++;
            }
        }
    }
}


    cout << "Number of solutions: " << count;


    return 0;

}

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

int main(){
int a[5][51];
int b;
int c;
int d;
b=1;
while(b<5){
c=0;
while(c<51){
a[b][c]=0;
c=c+1;}
b=b+1;}

b=0;
while(b<10){
a[1][b]=1;
b=b+1;}

b=2;
while(b<5){
c=0;
while(c<51){
d=0;
while(d<9){
if(c>=d){a[b][c]=a[b][c]+a[b-1][c-d];}
d=d+1;}
c=c+1:}
b=b+1;}
int n;
while(cin >> n){
cout << a[4][n] << endl;}


}

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

int main(){
	
	int n;
	int a, b, c, d;
	int combsum=0;

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

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