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,n,x=0;
    cin >> n;
    for(a=0;a<10;a++){
        for(b=0;b<10;b++){
            for(c=0;c<10;c++){
                for(d=0;d<10;d++){
                    if(n==a+b+c+d)x=x+1;
                }
            }
        }
    }
    cout << x << endl;
 return 0;
}

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

using namespace std;

int n, s;
int dp[10][100][10];
int solve(int i, int j, int k);

int main(void){
	
	while(cin >> n >> s){
		if(n == 0 && s == 0){break;}
		fill_n(**dp,10*100*10,-1);
		cout << solve(0,0,10) << endl;
	}
}

int solve(int now, int sum, int b1){
	if(now == n){
		if(sum == s){return 1;}
		else return 0;
	}
	if(dp[now][sum][b1] != -1){return dp[now][sum][b1];}
	int t = 0;
	for(int i = 0; i < 10; i++){
		if(b1 != 10 && b1 >= i){break;}
		t += solve(now+1, sum + i, i);
	}
	return dp[now][sum][b1] = t;
}

C++: #include <cstdio>

using namespace std;
 
int main() {
	int n;
	int i, j, k, m;
	int counter;
	
	while (scanf("%d", &n) != EOF) {
	    counter = 0;
	    
	    for (i = 0; i < 10; i++) {
	        for (j = 0; j < 10; j++) {
	            for (k = 0; k < 10; k++) {
	                for (m = 0; m < 10; m++) {
	                    if ((i + j + k + m) == n) counter++;
	                }
	            }
	        }
	    }
	    
	    printf("%d\n", counter);
	}
	
	return 0;
}

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

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

int a,b,x;

int mySet(int d){
  for(int i=0;i<10;i++){
    if(d<3){
      mySet(d+1);
    }else if(d==3){
      if(a==x){
      b++;
      }
    }
    a++;
  }
  return a=a-10;
}

int main(void){
  cin>>x;
  mySet(0);
  cout<<b<<endl;
  return 0;
}

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

int num, ans = 0;
int ary[MAX] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

void dfs(int sum, int count) 
{
	if (count == 4 || sum == num) {
		if (sum == num) ans++;
	}else {
		for (int j = 0; j < MAX; j++) {
			dfs(sum+ary[j], count+1);
		}
	}
}

int main(void)
{
	while (cin >> num) {
		ans = 0;
		dfs(0, 0);
		cout << ans << endl;
	}
	
	return 0;
}

C++: 
/*
 * main.cpp
 *
 *  Created on: 2011/04/08
 *      Author: satoki
 *      5:01 ~ 5:09
 */
#include <iostream>
#include <string.h>
using namespace std;

int iN;

bool input() {
  if (scanf("%d", &iN) == EOF) return false;
  return true;
}

int manage() {
  int a, b, c, d, cnt = 0;
  for (a = 0; a < 10; a++) {
    for (b = 0; b < 10; b++) {
      for (c = 0; c < 10; c++) {
        for (d = 0; d < 10; d++) {
          if (a + b + c + d == iN) cnt++;
        }
      }
    }
  }
  return cnt;
}

int main() {
  while (1) {
    if (!input()) break;
    printf("%d\n", manage());
  }
  return 0;
}

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

int main(){
    int n;
    while(scanf("%d", &n) != EOF){
        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;
    }
}

C++: 
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
    
#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)
#define risi (0.05)

using namespace std;


int main(void)
{
    int a,b,c,d;
    int i,j,k,l;
    int number;
    int answercounter = 0;
    int answerarray[1000] = {0};
    int temp = 0;
    while(cin >> number)
    {
        for(i = 0;i <= 9;i++)
            if(i <= number)
                for(j = 0;j<=9;j++)
                    if(i+j<= number)
                        for(k = 0;k<=9;k++)
                            if(i+j+k <= number)
                                for(l = 0;l<=9;l++)
                                    if((i+j+k+l) == number)
                                        temp++;
        answerarray[answercounter] = temp;
        temp = 0;
        answercounter++;
        
                                        
    }
    REP(i,answercounter)
    cout << answerarray[i] << endl;
    return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	cin >> n;

	int count = 0;
	vector<int> result;
	while(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++)
						if(a+b+c+d == n)
							count++;

		result.push_back(count);
		count = 0;
	}

	for(const int& x : result){
		cout << x << endl;
	}


	return 0;
}

C++: #include <iostream>

int n;

bool get_input()
{
//	std::cout << "get_input" << std::endl;
	return (std::cin >> n);
}

// no_use: Â©¦éÌÂ
int solve(int sum, int no_use)
{
//	std::cout << "solve " << "sum: " << sum << "no_use: " << no_use << std::endl;
	if (no_use == 1) {
		if (0 <= sum && sum <= 9) {
			return 1;
		} else {
			return 0;
		}
	} else {
		int ans = 0;
		for (int i = 9; i >= 0; i--) {
			if (sum <= i) continue;
			ans += solve(sum - i, no_use - 1);
		}
		return ans;
	}
}

void output(int ans)
{
	std::cout << ans << std::endl;
}

int main(void)
{
	while (get_input()) {
		output(solve(n, 4));
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int sum_of_2_integers(int n) {
        int a,b;
        int count = 0;
        for (a=0; a < 10; a++) {
                b = n - a;
                if (b < 0) break;
                if (b <= 9) count++;
        }
        return count;
}

int sum_of_4_integers(int n) {
        int a,b;
        int count = 0;
        for (a=0; a <= 18; a++) {
                b = n - a;
                if (b < 0) break;
                if (b <= 18) {
                        count = count + sum_of_2_integers(a)*sum_of_2_integers(b);
                }
        }
        return count;
}

int main(void) {
        int n;
        while(cin >> n) {
                cout << sum_of_4_integers(n);
                cout << endl;
        }

        return 0;
}

C++: #include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;
int main(){
	while(1){
		int n,cnt=0;
		int a,b,c,d;
		cin>>n;
		if(cin.eof()) {break;}
 		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) cnt++;
			}
		    }
		  }
		}
 	        cout<<cnt<<endl;
	}
	return 0;	
}

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

int main() {
	int a, b, c, d, n,e=0;
	cin >> n;
	for (a = 0; a < n; a++) {
		for (b = 0; b < n; b++) {
			for (c = 0; c < n; c++) {
				for (d = 0; d < n; d++) {
					if (a + b + c + d == n)e++;
				}
			}
		}
	}
	cout << e<<endl;
	return 0;
}