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 c = 0;
int main()
{
	int num;
	while (cin >> num)
	{
		if (num > 36 || num < 0)
		{
			cout << 0 << endl;
			continue;
		}
		else
		{
			for (int i = 0; i <= 9; i++)
				for (int j = 0; j <= 9; j++)
					for (int k = 0; k <= 9; k++)
						for (int v = 0; v <= 9; v++)
						{
							if (i + j + k + v == num)
								c++;
						}
		}
	}
	cout << c << endl;
	return 0;
}

C++: #include "stdio.h"

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

	scanf("%d", &n);

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

C++: #include <iostream>
#include <cmath>
int GetCombination(int n)
{
    int Result = 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) ++Result;
                }
            }
        }
    }
    return Result;
}

int main()
{
    while(true){
        int n;
        std::cin >> n;
        if(std::cin.eof()) break;
        std::cout << GetCombination(n) << std::endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
	int n, ans;
	while (cin >> n) {
		ans = 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) {
							ans++;
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
	cout << ans << endl;
	return 0;
}

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

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

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

#define rep(i, n) for(int i=0; i<n; i++)

int main(){
	int n;
	while(cin>>n){
		int ans = 0;
		rep(i, 10){
			rep(j, 10){
				rep(k, 10){
					rep(l, 10){
						if(i+j+k+l==n){
							ans++;
						}
					}
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

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

int main(){
	int n;
	string str;
	while(1){
		int cnt = 0;
		getline( cin, str );
		sscanf( str.c_str(), "%d", &n );
		if( str.size()==0 )	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( n == a+b+c+d ){
							cnt++;
						}
					}
				}
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

C++: //0008 Sum of 4 Integers
//n(<=50)ツつェツ与ツつヲツづァツづェツつスツづつォツ、a+b+c+d=nツづづ按づゥツ組ツづ個古つ青板づーツ出ツ療債つケツづヲ
//ツ禿シツ療債づ個終ツづュツづィツづ孔OFツづ与ツつヲツづァツづェツづゥ

#include<iostream>
#include<numeric>
using namespace std;

int main(void)
{
	const int N = 4;
	int a[N];
	int n;
	while( cin >> n)
	{
		int count = 0;
		for(int i = 0; i < 9*9*9*9; i++)
		{
			a[0] = i/9/9/9 + 1;
			a[1] = i/9/9%9 + 1;
			a[2] = i/9%9 + 1;
			a[3] = i%9 + 1;
			if(accumulate(a, a+N, 0) == n)
				count++;
		}
		cout << count << endl;
	}
}

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	int sum,ans=0;
	while(cin>>sum){
		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(sum==i+j+k+l) ans++;
					}
				}
			}
		}
		cout<<ans<<endl;
	}
}

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

int main(void){
	int a,b,c,d;
	int n;
	int count;

	while(cin>>n){
		count=0;
		if(n>36){
			cout << "0" << endl;
			continue;
		}
		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==n) count++;
					}
				}
			}
		}
		cout << count << endl;
	}

	return 0;
}

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

int main(void) {
  int sum;
  while (scanf("%d", &sum)+1) {
    printf("%d\n", sum);
    if (sum > 36) 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>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;

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

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

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

C++: #include<stdio.h>

int main()
{
	int n[2];
	scanf("%d",&n[0]);
	scanf("%d",&n[1]);

	int output[2] ={0};
	for(int x=0;x<2;x++)
	{
		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[x])
						{
							output[x]++;
						}	
					}
				}
			}
		}
		printf("%d\n",output[x]);
	}
}

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

C++: #include <iostream>

using namespace std;
 

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

	return 0;
}