Go: package main

import "fmt"

var count int

func main() {
	var inputNum int
	for {
		fmt.Scanf("%d", &inputNum)
		fmt.Printf("%d\n", calcA(inputNum))
		count = 0
	}
}

func calcA(input int) int {
	for i := 0; i <= 9; i++ {
		calcB(input, i)
	}
	return count
}

func calcB(input, a int) {
	for i := 0; i <= 9; i++ {
		calcC(input, a, i)
	}
}

func calcC(input, a, b int) {
	for i := 0; i <= 9; i++ {
		calcD(input, a, b, i)
	}
}

func calcD(input, a, b, c int) {
	for i := 0; i <= 9; i++ {
		if a+b+c+i == input {
			count++
		}
	}
}

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

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

using namespace std;
int main(){
  const int MAX_value = 9;
  const int min_value = 0;
  int n;
  for(int i=0;!cin.eof();i++){
    /*    if(i!=0 && cin.eof()==false) {
      cout << i << "Fin";
      break;
      }*/
    //    cout << " " << i;
    int count =0;
    cin >> n;
    for(int a=min_value;a<MAX_value+1;a++){
      for(int b=min_value;b<MAX_value+1;b++){
	for(int c=min_value;c<MAX_value+1;c++){
	  for(int d=min_value;d<MAX_value+1;d++){
	    //cout << d <<endl;
	    if(a+b+c+d==n){
	      count++;
	    }
	  }
	}
      } 
    }
  cout << count<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int cnt = 0;
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        for (int k = 0; k < 10; k++) {
          if (0 <= n - i - j - k && n - i - j - k < 10) cnt++;
        }
      }
    }
    cout << cnt << endl;
  }
}

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

int main(){
	int n, t = 0;
	int out[100] = {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++){
						if(a+b+c+d == n){
							out[t]++;
						}
					}
				}
			}
		}
		t++;
	}
	for(int i = 0; i < t; i++){
		cout << out[i] << endl;
	}
}