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 <iostream>
using namespace std;
 
int solve(int 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){
                    int tmp = i + j + k + l;
                    if(tmp == N) ans++;
                }
            }
        }
    }
    return ans;
}
 
int main(){
    int N;
    while(cin >> N){
        int ans = solve(N);
        cout << ans << endl;
    }
}

C++: #include <iostream>
using namespace std;
int ary[60],res[40];
int main(){
	int N;
	for(int i=1;i<=51;i++){
		cin>>ary[i];
		if(cin.eof()){
			N=i-1;
			break;
		}
	}
	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++){
					res[i+j+k+l]++;
				}
			}
		}
	}
	for(int i=1;i<=N;i++){
		if(ary[i]>=0&&ary[i]<=36)cout<<res[ary[i]]<<endl;
		else cout<<0<<endl;
	}
	return 0;
}

C++: #include<iostream>

int main(){
	int n;
	int count = 0;
	while (std::cin >> n){
		count = 0;
		if (n <= 36){
			for (int a = 0; a <= 9; ++a){
				for (int b = 0; b <= 9; ++b){
					for (int c = 0; c <= 9; ++c){
						if (a + b + c >= n - 9 && a + b + c <= n)++count;
					}
				}
			}
		}
		std::cout << count << std::endl;
	}
	return 0;
}

C++: #include <cstdio>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main() {
  int n;
  while(scanf("%d",&n) != EOF) {
    int t = 0;
    REP(i,10) {
      if(i > n) break;
      REP(j,10) {
	if(i+j > n) break;
	REP(k,10) {
	  if(i+j+k > n) break;
	  REP(l,10) {
	    if(i+j+k+l > n) break;
	    else if(i+j+k+l == n) t += 1;
	  }
	}
      }
    }
    printf("%d\n", t);
  }

  return 0;
}

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

int main() {

  int n;
  while ( cin >> n ) {

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

    cout << cnt << endl;

  }

  return 0;

}

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

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long int ll;
typedef vector<long long int> vi;

int main(){
	ll n, c = 0;
	while (cin >> n){
		REP(i, 10){
			REP(j, 10){
				REP(k, 10){
					REP(l, 10){
						if (i + j + k + l == n)c++;
					}
				}
			}
		}
		cout << c << "\n";
		c = 0;
	}
}

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

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

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

C++: #include <iostream>
#define rep(i,a) for(int i=0;i<a;++i)

using namespace std;

int main(void)
{
	int n;
	int a[4];
	while(cin >> n,n)
	{
		int count = 0;
		rep(i,10)
		{
			rep(j,10)
			{
				rep(c,10)
				{
					rep(d,10)
					{
						if(i+j+c+d == n)
							++count;
					}
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

int sumDigit(int n) {
    int ret = 0;

    while (n) {
        ret += n % 10;
        n /= 10;
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    VI nums;
    
    int t;
    while (cin >> t) {
        nums.push_back(t);
    }
    
    for (auto n : nums) {
        int ans = 0;
        REP(i, 0, 10000) {
            if (n == sumDigit(i))   ++ans;
        }
        cout << ans << endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
int p,ans=0;
	int main(){
		while(cin>>p){
			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==p){ans++;}}}}}
		cout<<ans<<endl;
		ans=0;}
		return 0;}

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



int main(void){	

	int n,count=0;
	while (cin >> n){

		for (int i = 1; i < 10; i++){
			for (int j = 1; j < 10; j++){
				for (int k = 1; k < 10; k++){
					for (int l = 1; l < 10; l++){

						if (i + j + k + l == n){
							count++;
						}

					}
				}
			}
		}cout << count << endl;

	}
	
	return 0;
}

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

int main()
{
	int n;
	while(cin>>n)
	{
		int 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;
	}
	return 0;
}

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

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

int main()
{
	int num;
	int i, j, s, t;
	
	while(cin >> num){
		int count = 0;
		
		for(i=0; i<=9; i++){
			for(j=0; j<=9; j++){
				for(s=0; s<=9; s++){
					for(t=0; t<=9; t++){
						if((i+j+s+t) == num){
							++count;
						}
					}
				}
			}
		}
		cout << count << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
int main()
{
  int i,j,k,l,cou,n;
  while(scanf("%d",&n)!=EOF){
    cou=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)cou++;
	  }
	}
      }
    }
  }
  printf("%d\n",cou);
  return 0;
}

C++: #include<iostream>
#include <stdio.h>
#include<vector>
using namespace std;
int dfs(int n, int level){
    //printf("%d %d\n", n, level);
    if(n<0) return 0;
    if (level == 0 && n<0) return 0;
    if(level == 0 && n == 0) return 1;
    if(level > 0){
        int sum = 0;
        for(int i=0; i<=9; i++){
            if(i<=n)
                sum += dfs(n-i, level-1);
        }
        return sum;
    }
    return 0;
}
int main(){
    int n;
    while(scanf("%d\n", &n)!=EOF){
        printf("%d\n", dfs(n, 4));
    }
}

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

int main(void){
     int n,i=0;
     cin >> n;
     while(!cin.eof()){
	  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(n == a+b+c+d){
				   i = i+1;
			      }
			 }
		    }
	       }
	  }
     }

     cout << i << endl;

     return 0;
}

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

int main(){
  int a,cou;
  while(cin>>a){
    cou=0;
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	for(int k=0;k<10;k++){
	  for(int q=0;q<10;q++){
	    if(i+j+k+q==a)cou++;
	  }
	}
      }
    }
    cout<<cou<<endl;
  }
  return 0;
}