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 <stdio.h>

int main(void){
int n,a,b,c,d,i=0;
scanf("%d",&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(a+b+c+d==n){
i++;
}
}
}
}
}
printf("%d\n",i);
return 0;
}

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

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

    return 0;
}

C++: #include <iostream>

using namespace std;

int combinations[51] = {};

int main() {
    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++) {
                    combinations[a + b + c + d] += 1;   
                }
            }
        }
    }

    int n;
    while (cin >> n) {
        cout << combinations[n] << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a;
int b;
int c;
int main(){

	
	while (cin >> a){
                        c++;
			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 ==a ){
								b++;
							}
						}
					}
				}
			}
}
for(int i = 0;i<c;i++){	
cout << b << endl;
}

	return 0;
}

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

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

/*
inline int factorial(int n)
{
    int x = 1;
    for (;n != 0; n--)
        x *= n;
    return x;
}

inline int factorial(int s, int n)
{
    int x = 1;
    for (;n > s; n--)
        x *= n;
    return x;
}

inline int conbination(int n, int r)
{
    return factorial(n - r, n) / factorial(r);
}

inline int homogeneous(int n, int r)
{
    return conbination(n + r - 1, r);
}
*/

int calc(int n, int k)
{
    if (k == 0)
        return 0;

    for (int i = 0; i <= 9; i++) {
        n -= i;
        if (n < 0)
            return 0;
        else
            return 1 + calc(n, k - 1);
    }

}

int main()
{
    for (int n; cin >> n;)
        cout << n << " " << calc(n, 4) << endl;

    return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<ctype.h>
#include<math.h>
#include<map>
using namespace std;
int main() 
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int count=0;
		int i,j,k,l;
		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)
							count++;
		printf("%d\n",count);
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>

using namespace std;


int main(){
	int n = 0;
	int count;
	while(cin >> n){
		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 m = 0; m < 10; m++){
						if((i + j + k + m) == n){
							count++;
						}
					}
				}
			}
		}

		cout << count << endl;
	}

	return 0;
}

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

int solve(int n){
    int ans = 0;
    int i, j, k, l;
    if(n > 36) return 0;
    for(i=0; i<=min(n, 9); i++){
      for(j=0; j<=min(n-i, 9); j++){
        for(k=0; k<=min(n-i-j, 9); k++){
          if(0 <= n-i-j-k && n-i-j-k <= 9) {
          	ans++;
          	//cout << n-i-j-k << endl;
          }
        }
      }
    }
    return ans;
}




int main() {
    ios::sync_with_stdio(false);
    int n;
    while(cin >> n){
      cout << solve(n) << endl;
    }
    return 0;
}

C++: #include<stdio.h>
 
int main(){
    int a;
    while(~scanf("%d",&a)){
        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==a)ans++;
        printf("%d\n",ans);
    }
}

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

int main()
{
	int N; cin >> N;
	
	int 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++)
				{
					int s = a + b + c + d;
					if(s == N)count++;
					else if(s > N)break;
				}
			}
		}
	}
	cout << count << endl;
	return 0;
}

C++: #include <iostream>

void calc(int i, int n, int& cnt) {
	if (n==0) {
		cnt++;
		return;
	}
	if (i>=4) {
		return;
	}
	int max = n < 9 ? n : 9;
	for (int j=0; j<=max; j++) {
		calc(i+1, n-j, cnt);
	}
}

int main() {
	int n, cnt;
	while (std::cin >> n) {
		cnt = 0;
		calc(0, n, cnt);
		std::cout << cnt << std::endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		int answer = 0;
		for(int a=0;a<10;a++){
			int m = n-a;
			for(int b=0;b<10;b++){
				int l = m-b;
				for(int c=0;c<10;c++){
					int k = l-c;
					for(int d=0;d<10;d++){
						if(d == k) answer++;
					}
				}
			}
		}
	cout<<answer<<endl;
	}
	return 0;
}

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

#define rep(i,n) for(int i=0; i<n; i++)
int main(){
	int n, ans;
	ans=0;
	cin >> n;
	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 <iostream>

using namespace std;

int main(){

  int n;

  while( cin >> n ){

    int 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) cnt++;
	  }
	}
      }
    }
    cout << cnt << endl;
  }  
}

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

int main(){
int a[5][51];
int b;
int c;
int d;
b=1;
while(b<5){
c=0;
while(c<51){
a[b][c]=0;
c=c+1;}
b=b+1;}

b=0;
while(b<10){
a[1][b]=1;
b=b+1;}

b=2;
while(b<5){
c=0;
while(c<51){
d=0;
while(d<9){
if(c>=d){a[b][c]=a[b][c]+a[b-1][c-d];}
d=d+1;}
c=c+1;}
b=b+1;}
int n;
while(cin >> n){
cout << a[4][n] << endl;}


}

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


int main()
{
	int i, S, n;
	while (cin >> n) {
		i = 0;
		for (S = 1;S <= 9999;S++) {
			if (S/1000+(S-S/1000*1000)/100+(S-S/100*100)/10+S-S/10*10==n)  
				i++;
		}
		cout << i << endl;
	}
    return 0;
}

C++: #include<cstdio>
int main(){for(int i,c,k,n,j;scanf("%d",&n);k=0){for(i=0;i<1e4;c=0){for(j=i++;j>0;j/=10)c+=j%10;c-n?k:k++;}printf("%d\n",k);}}