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

C++: #include <iostream>

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define INF (int) 2e9
#define MOD (int) 1e9 + 7

int main(){
    int n;
    while(cin >> n){
        int cnt = 0;
        rep(a, 10){
            rep(b, 10){
                rep(c, 10){
                    rep(d, 10){
                        if(a+b+c+d == n) cnt++;
                    }
                }
            }
        }
        cout << cnt << endl;
    }
    return 0;
}

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

int main(){
	int in;
	while (cin >> in, !cin.eof()){
		int ans = 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 == in)	ans++;
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int gcd( int, int );

int main()
{
	int n, count;

	while ( cin >> n )
	{
		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++;
						}
					}
				}
			}
		}
		printf("%d\n", count );
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int calc(int a, int b, int n) {
	int tmp = n-a-b;
	int count = 0;
	for (int c=0; c<10; c++) {
		for (int d=0; d<10; d++) {
			if (tmp == c+d)
				count++;
		}
	}
	return count;
}

void solve(int n) {
	int count = 0;
	for (int a=0; a<10; a++) {
		for (int b=0; b<10; b++) {
			count += calc(a,b,n)
		}
	}
	cout << count << endl;
}

int main() {
	int n;
	while (cin >> n) {
		solve(n);
	}
	return 0;
}

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

int res(int n){
 int count = 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) count++;

 return count;
}
int main()
{
 int n;
 while(cin >> n)
  res(n);

 return 0;
}

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

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

}

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

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

C++: #include <iostream>
#include <vector>
#include <math.h>
#include <string>

int main(void);
int combination(int n);
bool combination_sub(int a, int b, int c, int d, int n);

int main(){
	int n;				//入力されるデータセット
	int cnt = 0;		//データセット入力カウント
	std::vector<int> result;		//組み合わせ個数を格納する配列

	while (std::cin >> n){
	//while (cnt < 2){
		//std::cin >> n;
		result[cnt] = combination(n);
		cnt++;
	}

	for (int i = 0; i < (sizeof(result) / sizeof(result[0])); i++){
		std::cout << result[i] << std::endl;
	}

	//while (1);
	return 0;
}

int combination(int n){
	int rtn = 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 (combination_sub(a, b, c, d, n)){
						rtn++;
					}
				}
			}
		}
	}

	return rtn;
}

bool combination_sub(int a, int b, int c, int d, int n){
	if ((a + b + c + d) == n){
		return true;
	}
	else{
		return false;
	}
}

C++: #include<cstdio>
int main(){
	int n;
	int i,j,k;
	while(scanf("%d",&n) != EOF){
		int counter = 0;
		for(i=0;i<=9;i++){
			for(j=0;j<=9;j++){
				for(k=0;k<=9;k++){
					if(n-(i+j+k) >= 0 && n-(i+j+k) <= 9){
						counter++;
					}
				}
			}
		}
		printf("%d\n",counter);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int sum2(int n, int total, int stage)
{
  int count = 0;

  if (stage == 4) {
    if (total == n) return 1;
    return 0;
  }

  if (total > n) return 0;

  for (int i = 0; i < 10; i++) {
    count += sum2(n, total + i, stage + 1);
  }

  return count;
}

int sum(int n)
{
  int count = 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) count++;

  return count;
}

int main(void)
{
  int n;

  while (cin >> n) cout << sum2(n, 0, 0) << endl;

  return 0;
}

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

int partition(int s,int k,int n){
	if(s<0) return 0;
	if(s>9 && n==1) return 0;
	
	if((s>=0 && s<=min(9,s)) && n==1)return 1;
	int ret=0;
	int x=k;
	for(x=0;x<=min(9,s);x++){
		ret+=partition(s-x,x,n-1);
	}
	return ret;
}

int main(void){
int s;

//	for(s=1;s<=50;s++)cout<<s<<":"<<partition(s,0,4)<<endl;
	while(cin>>s && s!=EOF){
		if(s>18)s=36-s;
		cout<<partition(s,0,4)<<endl;
	}


return 0;
}

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

using namespace std;

int main()
{
	string str = "";

	while (getline (cin, str) ) {
		int n = 0;
		int res = 0;
		stringstream ss(str );
		ss >> n;

		for (int i = 0; i < 10000; ++i ){
			int a = i/1000;
			int b = (i/100) % 10;
			int c = (i/10) % 10;
			int d = i % 10;
			
			if (a + b + c + d == n ){
				++res;
			} // end if
		} // end for
		cout << res << endl;	
	} // end while

	return 0;
}