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<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		if(n>36) cout<<0<<endl;
		else
		{
			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;
		}
	}
}

C++: #include <stdio.h>

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

	while( scanf("%d", &n)!=EOF ){
		ans = 0;
		if(n<=36){
			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){
								ans++;
							}
						}
					}
				}
			}
		}
		printf("%d",ans);
	}
	return 0;
}

C++: #include <algorithm>

#include <stdio.h>
#include <string.h>

int n;

int memo[4 + 1][50 + 1];

int search(int i, int j)
{
  if (memo[i][j] >= 0)
    return memo[i][j];

  if (j > i * 9)
    return memo[i][j] = 0;

  if (i == 1)
    return memo[i][j] = 1;

  int c = 0;

  for (int k = 0; k <= j && k <= 9; k ++)
    c += search(i - 1, j - k);

  return memo[i][j] = c;
}

int main(int argc, char** argv)
{
  while (fscanf(stdin, "%d", &n) == 1) {
    memset(memo, -1, sizeof(memo));
    
    fprintf(stdout, "%d\n", search(4, n));
  }
}

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

int main() {
  int n, ans;
  while (cin >> n) {
    ans = 0;
    for (int i=0;i<10000;i++) {
      int a = i%10, b = i%100/10, c = i%1000/100, d = i%10000/1000;
      if (a + b + c + d == n) {
        // cout << " " << a << ", " << b << ", " << c << ", " << d << endl;
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main() {
	int N, X[19] = {}, XX[37] = {};
	for (int i = 0; i <= 9; i++) {
		for (int j = 0; j <= 9; j++) {
			X[i + j]++;
		}
	}
	for (int i = 0; i <= 18; i++) {
		for (int j = 0; j <= 18; j++) {
			XX[i + j] += X[i] * X[j];
		}
	}
	while (cin >> N) {
		if (N > 36) cout << 0 << endl;
		else cout << XX[N] << endl;
	}
}

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

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

C++: #include <iostream>

int main()
{
	int n;
	while( std::cin >> n )
	{
		int num = 0;
		for( int i1=0; i1<=9; ++i1 )
		{
			for( int i2=0; i2<=9; ++i2 )
			{
				for( int i3=0; i3<=9; ++i3 )
				{
					for( int i4=0; i4<=9; ++i4 )
					{
						num += (i1+i2+i3+i4 == n);
					}
				}
			}
		}

		std::cout << num;
	}
}

C++: #include<iostream>
#include<cstdio>
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;
}

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

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

int DP[10][100];
int N;

int main()
{
	while(scanf("%d",&N)!=EOF)
	{
		memset(DP,0,sizeof(DP));
		DP[0][0]=1;
		for(int i= 0;i<=4;i++)
		{
			for(int j=0;j<=N;j++)
			{
				for(int k=0;k<10;k++)
				{
					DP[i+1][j+k]+=DP[i][j];
				}
			}
		}
		printf("%d\n",DP[4][N]);
	}

}

C++: #include <stdio.h>

int main(void)
{
  int n,i;

  i = 0;
  while(i < 50){
    int ans = 0;
    scanf("%d", &n);
    if( n == -1){
      break;
    }
    if(n <= 36){
      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){
		ans++;
	      }
	    }
	  }
	}
      }
    }
    printf("%d\n", ans);
    i++;
  }
  return 0;
}

C++: #include <cstdio>
#include <cstdlib>

int main(){
 int n;
 int ans = 0;
 while(true){
 n = null;
 scanf("%d\n",&n);
 if(n == null) break;
 ans = 0;
 for(int a = 9;a >= 0;a--){
   for(int b = 9;b >= 0;b--){
     for(int c = 9;c >= 0;c--){
       for(int d = 9;d >= 0;d--){
        if(a+b+c+d == n){ans++; break;}
        if(a+b+c+d < n) break;
       }
     }
   }
 }
 printf("%d\n",ans);
 }
}

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

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

C++: #include<iostream>
#include<string>
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;
	}
	return 0;
}

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

C++: #include<cstdio>

int solve(int a,int b){
	if(a==0){
		if(0<=b&&b<=9)return 1;
		else return 0;
	}
	int res=0;
	for(int i=0;i<10;i++){
		res+=solve(a-1,b-i);
	}
	return res;
}

int main(){
	int a;
	while(~scanf("%d",&a);)	printf("%d\n",solve(3,a));
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int n;
	while ( cin >> n ) {
		int count;
		if (n>36) count = 0;
		else {
			if (n>18) n = 36 - n;
			count = ((n+1)*(n+2)*(n+3))/6;
		}
		cout << count << endl;
	}
	
	return 0;
}

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

C++: #include <iostream>
 
using namespace std;
 
int main(){
    int L=0,N,A,B,C,D;
    while(cin>>N){L=0;
    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){L++;};
                };};};};
 
    cout<<L<<endl;};
    cin>>L;
        return 0;
 
}