Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
	}
	for _, value := range resultArr {
		fmt.Println(value)
	}
}

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<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int i,j,k,l,n,cnt;
	while(scanf("%d",&n)!=EOF) {
		cnt=0;
		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) {
							cnt++;
						}
					}
				}
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);

int main(void){
	int dp[4][51];
	fill_n(*dp, 4*51, 0);
	rep(i, 10)dp[0][i] = 1;
	for(int i = 1; i <= 3; i++){
		for(int j = 36; j >= 0; j--){
			for(int k = 0; k <= 9; k++){
				if(j-k < 0)break;
				dp[i][j] += dp[i-1][j-k];
			}
		}
	}
	int n;
	while(cin >> n)
		FIN(dp[3][n]);

	return 0;
}

C++: #include <stdio.h>

int sumInts(int n,int i);

int main(){
	int n;
	
	while(scanf("%d",&n)!=EOF){
		printf("%d\n",sumInts(n,4));
	}
	
	return 0;
}

int sumInts(int n,int i){
	int j,sum=0;
	if(i==1){
		if(n>9){
			sum=0;
		}else if(n<0){
			fprintf(stderr,"error\n");
		}else{
			sum=1;
		}
	}else{
		for(j=0;j<=9;j++){
			if (n<j) break;
			sum+=sumInts(n-j,i-1);
		}
	}
	
	
	return sum;
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c,d,n,x,sum=0;
	for(;;){
		cin>>x;
	for(a=0;a<=9;a++){
		for(b=0;b<=9;b++){
			for(c=0;c<=9;c++){
				for(d=0;d<=9;d++){
					n=a+b+c+d;
					if(x==n){
						sum++;
					}
				}
			}
		}
	}
	cout<<sum<<endl;
	sum=0;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int seach(int n,int m){
	if(m==4){
		return (n==0);
	}
	else{
	int res=0;
	for(int i=0;i<10;i++){
		res+=seach(n-i,m+1);
	}
	return res;
}
}

int main() {
	int n;
	cin >> n;
	cout << seach(n,0) << endl;
	return 0;
}

C++: #include <iostream>

const int N = 9;

int main(void) {
  int n = 0;

  std::string line;

  while (!std::cin.eof()) {
    std::cin >> n;
      
    int count = 0;
    
    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= N; j++) {
	for (int k = 0; k <= N; k++) {
	  for (int l = 0; l <= N; l++) {
	    if ((i + j + k + l) == n) {
	      count++;
	    }
	  }
	}
      }
    }

    std::cout << count << std::endl;

    std::cin >> n;
  }
   
  return 0;
}

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

return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, x, cnt;
    while(cin >> n){
        x = 0;
        for(int i = 0; i < 10; i++){
            for(int j = i; j < 10; j++){
                for(int k = j; k < 10; k++){
                    for(int l = k; l < 10; l++){
                        if(n == i + j + k + l){
                            cnt = 0;
                            if(i == j || i == k || i == l)  cnt++;
                            if(j == k || j == l)    cnt++;
                            if(k == l)  cnt++;
                            if(cnt == 3)   x++;
                            else if(cnt == 2)   x += 4; 
                            else if(cnt == 1){
                                if(i == j && j != k && k != l)  x += 12;
                                else if(j == k && i != j && k != l)  x += 12;
                                else if(k == l && i != j && j != k)  x += 12;
                                else    x += 4;
                            }
                            else    x += 24;
                        }
                    }
                }
            }
        }
        cout << x << endl;
    }
    
    return 0;
}

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

int main(){
  int a,b,c,d,n,count = 0;
  
  while(scanf("%d",&n)!=EOF){
  
  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;
  count =0;
  }
  return 0;
}

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

int main()
{
	int n, cnt;

	while(cin >> n, n)
	{
		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 <bits/stdc++.h>


int main()
{
    int N, sum;

    while(std::scanf("%d", &N) != EOF) {
        if (N > 36) std::printf("%d\n", 0);
        else {
            sum = 0;
            for (int i = 0; i <=9; i++) {
                if (i > N) break;
                for (int j = 0; j <= 9; j++) {
                    if (i + j > N) break;
                    for (int k = 0; k <= 9; k++) {
                        if (i + j + k > N) break;
                        for (int l = 0; l <= 9; l++) {
                            if (i + j + k + l > N) break;
                            if (i + j + k + l == N) sum++;
                        }
                    }
                }
            }
            std::printf("%d\n", sum);
        }
    }

    return 0;
}

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

C++: #include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){
  int a,b,c,d,n,count = 0;
  while(scanf("%d",&n)!=EOF){
     
    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;

int main() {
	int a, b, c, d, n, e = 0;
	for (;;) {
		cin >> 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)e++;
					}
				}
			}
		}
		cout << e << endl;
	}
	return 0;
}