Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

C++: #include <stdio.h>

int main( void ){
    int nCount = 0;
    int n[];
    while( true ){
    

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

    printf( "%d\n",nCount );
    }
    return 0;
}

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

int main() {
	int n;
	while (cin >> n) {
		int num = 0;
		if (n > 36) {
			cout << "0" << endl;
		}
		else {
			for (int i = 0; i < 10; i++) {
				if (i > n) {
					break;
				}
				for (int j = 0; j < 10; j++) {
					if (i + j > n) {
						break;
					}
					for (int k = 0; k < 10; k++) {
						if (i + j + k > n) {
							break;
						}
						for (int l = 0; l < 10; l++) {
							if (i + j + k + l > n) {
								break;
							}
							if (i + j + k + l == n) {
								num++;
							}
						}
					}
				}
			}
			cout << num << endl;
		}
	}
	return 0;
}

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

int main()
{
    int i,j,k,l,n,counter;
    while(cin>>n)
    {
        counter=0;
        if(n<37)
        {
            for(i=0;i<=9;i++)
                for(j=0;j<=9;j++)
                  for(k=0;k<=9;k++)
                    for(l=0;l<=9;l++)
            {
                if(i+j+k+l==n)
                    counter++;
            }
        }
        cout<<counter<<endl;
    }


    return 0;
}

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

int cnt=0;
int n;

int forf(int t,int ti){
    if(ti<4){
        for(int i=0;i<10;i++){
            forf(t+i,ti+1);
        }
    }else if(t==n)cnt++;
    return 0;
}

int main(){
    while(scanf(" %d",&n)){
        cnt=0;
        forf(0,0);
        cout << cnt << endl;
    }
    return 0;
}

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

int main(){
    int cnt, n;
    
    while(cin >> n){
        cnt = 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){
                            break;
                        }
                        if(i + j + k + l == n){
                            cnt++;
                        }
                    }
                }
            }
        }
        
        cout << cnt << endl;
    }
    
    return 0;
}

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

int Permutation(int a, int b, int c, int d)
{
	if(a==d)
		return 1;
	else if(a==c || b==d)
		return 4;
	else if(a==b || b==c || c==d)
		return 12;
	else
		return 24;
}

int main()
{
	int n;
	while(cin>>n)
	{
		int count=0;
		if(9+9+9+9 < n)
				break;
		for(int i=0; i<10; ++i)
		{
			if(i+9+9+9 < n)
					continue;
			for(int j=i; j<10; ++j)
			{
				if(i+j+9+9 < n)
						continue;
				for(int k=j; k<10; ++k)
				{
					if(i+j+k+9 < n)
							continue;
					for(int l=k; l<10; ++l)
					{
						if(i+j+k+l == n)
						{
							count+=Permutation(i,j,k,l);
							break;
						}
					}
					if(i+j+k > n)
						break;
				}
				if(i+j > n)
					break;
			}
			if(i > n)
				break;
		}
		cout << count << '\n';
	}
}

C++: #include <iostream>

using namespace std;
static int a = 0;


void re(int n, int t) {
    if(t == 0){
        if(n == 0) {
            a++;
            return;
        } else return;
    }

    for(int i = 0; i <= 9; i++) {
        re(n - i, t - 1);
    }

    return;
}

int main() {
    int n;
    while(cin >> n) {
        re(n, 4);
        cout << a << endl;
        a = 0;
    }

    return 0;
}

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

int main(){
	
	int a, b, c, d, n;
	int i;
	int cnt;

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

C++: 


#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
int main()
{
	int s;
	while (cin >> s) {
		int a = 0;
		for (int i = 0; i < 10; i++) {
			for (int k = 0; k < 10; k++) {
				for (int j = 0; j < 10; j++) {
					for (int l = 0; l < 10; l++) {
						if (i + k + j + l == s) { a++; }
					}
				}
			}
		}cout << a << endl;
	}
	return 0;
}

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

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

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

int main(void) {
  int in;
  int table[51];

  memset(table, 0, sizeof(table));
  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++) {
          table[a + b + c + d]++;
        }
      }
    }
  }
  while(cin) {
    cin >> in;
    cout << table[in] << endl;
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

#define MAX 256

int miku(int x){
	if(x > 36)return 0;
	if(x < 10)return (x + 3)*(x + 2)*(x + 1) / 6;
	if(x > 18)return miku(36 - x);
	if(x > 9 && x < 19)return (x + 3)*(x + 2)*(x + 1) / 6 - (miku(x - 10) * 4);
}

int main(void){
	int n,i = 0;
	int ans[MAX];
	
	while((n = cin.get()) != istream::traits_type::eof()){
		ans[i] = miku(n);
		i++;
	}
	
	for(int j = 0;j < i;j++){
		cout << ans [j] <<endl;
	}

	return 0;
}

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

bool binary_search(vector<int> a, int x){
	int left = 0, right = a.size() - 1;

	while (left <= right){
		int mid = (left + right) / 2;
		if (a[mid] == x) return true;
		else if (a[mid] < x) left = mid + 1;
		else right = mid - 1;
	}
	return false;
}

int main()
{
	vector<int> vec(19);
	int cnt = 0;
	for (auto& x : vec) x = cnt++;
	for (auto x : vec) cout << x << endl;
	int n;
	cnt = 0;
	while (cin >> n){
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				if (binary_search(vec, n - i - j)){
					if (n - i - j == 0 || n - i - j == 18) cnt++;
					else cnt += 2;
					//cout << "i:" << i << " j:" << j << "k + l:" << n - i - j << endl;
				}
			}
		}
		cout << cnt << endl;
		cnt = 0;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,j=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)
	    j++;
  cout<<j<<endl;
  j=0;
  }
  return 0;
}