Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		count := 0
		for i := 9; i >= 0; i-- {
			numCpy, _ := strconv.Atoi(scanner.Text())
			if numCpy-i >= 0 {
				for j := 9; j >= 0; j-- {
					numCpyi := numCpy - i
					if numCpyi-j >= 0 {
						for k := 9; k >= 0; k-- {
							numCpyj := numCpyi - j
							if numCpyj-k >= 0 {
								for l := 9; l >= 0; l-- {
									numCpyk := numCpyj - k
									if numCpyk-l == 0 {
										count++
										break
									}
								}
							}
						}
					}
				}
			}
		}
		fmt.Println(count)
	}

}

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

long long int gcd(long long int l, long long int r) {
	assert(l > 0 && r > 0);
	if (l > r)return gcd(r, l);
	else {
		const long long int num = r%l;
		if (num) {
			return gcd(l, num);
		}
		else {
			return l;
		}
	}
}
long long int lca(long long int l, long long int r) {
	return l / gcd(l, r)*r;
}
int getans(const int num, const int rest) {
	if (rest) {
		int ans = 0;
		for (int i = 0; i <= 9; ++i) {
			if (num >= i) {
				ans += getans(num - i, rest - 1);
			}
		}
		return ans;
	}
	else {
		return num == 0;
	}
}
int main() {
	int N;
	while (cin >> N) {
		cout << getans(N, 4) << endl;
	}
	return 0;
}

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

using namespace std;

int main() {
	int n, ans = 0;

	while(cin >> n) {

		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 <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( scanf( "%d",&n[m] ) != EOF ) m++;

    for( int a = 0;a < m;a++ ){
    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[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    nCount = 0;
    }
    return 0;
}

C++: #include <cstdio>
#define REP(i,n) for(int i=0;i<(n);i++)

int main(void) {
    int n;
    const int N = 10;
    while(~scanf("%d", &n)) {
        int ans = 0;
        REP(a,N) REP(b,N) REP(c,N) REP(d,N) {
            if(a+b+c+d == n) ans++;
        }
        printf("%d\n", ans);
    }
    return 0;
}

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

int main(void) {
  int sum;
  while (scanf("%d", &sum)+1) {
    if (sum > 36) {
      printf("0\n");
      return 0;
    }

    int count = 0;
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 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) == sum) count++;
          }
        }
      }
    }
    printf("%d\n", count);
  }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, x, cnt;
    while(cin >> n){
        x = 0;
        for(int i = 0; i < 10; i++){
            for(int j = i; j < 10; j++){
                for(int k = j; k < 10; k++){
                    for(int l = k; l < 10; l++){
                        if(n == i + j + k + l){
                            cnt = 0;
                            if(i == j || i == k || i == l)  cnt++;
                            if(j == k || j == l)    cnt++;
                            if(k == l)  cnt++;
                            if(cnt == 3)   x++;
                            else if(cnt == 2)   x += 4; 
                            else if(cnt == 1){
                                if(i == j && j != k && k != l || j == k && i != j && k != l || k == l && i != j && j != k)  x += 12;
                                else    x += 4;
                            }
                            else    x += 24;
                        }
                    }
                }
            }
        }
        cout << x << endl;
    }
    
    return 0;
}

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

C++: #include <iostream>

using namespace std;

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

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

C++: #include<cstdio>

using namespace std;

signed main(){
    int  n;
    while( scanf( "%d\n", &n ) != EOF )
    {
        int ret = 0l;
        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 ) ret++;
                }
            }
        }    
        printf( "%d\n", ret );
    }
    return 0;
}

C++: // 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

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

	int n;
	while(cin >> n){
		int ans = 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)ans++;
					}
				}
			}
		}
		cout << ans << '\n';
	}
	return 0;
}
// Write Here

C++: #include<iostream>

using namespace std;

int num,count,data[4];

void function(int n){

	if(n == 4){
		int sum = 0;
		for(int i=0;i<4;i++){
			sum += data[i];
		}
		if(sum == num){
			count++;
		}
	}

	else{
		for(int i=0;i<10;i++){
			data[n] = i;
			int tmpSum = 0;
			for(int j=0;j<n;j++){
				tmpSum += data[j];
			}
			if(tmpSum>35){
				break;
			}
			function(n+1);
		}
	}

}

int main(){

	int sum = 0;

	while(cin >> num){
		count = 0;

		function(0);

		cout<<count<<endl;
	}

	return 0;
}

C++: #include "stdio.h"

int main()
{
	int n, m, l;

	while(scanf("%d", &n) != EOF){
		m = n;
		l = 0;

		for (int a = 0; a < 10; a++){
			if (m < a) break;
			else m -= a;
			for (int b = 0; b < 10; b++){
				if (m < b) break;
				else m -= b;
				for (int c = 0; c < 10; c++){
					if (m < c) break;
					else m -= c;
					for (int d = 0; d < 10; d++){
						if (m < d) break;
						else if(m == d) l++;
					}
					m += c;
				}
				m += b;
			}
			m += a;
		}

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

	return 0;
}

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

int main(void)
{
  int n;

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

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

      cout << count << endl;
    }

  return 0;
}