Go: package main
import (
	"fmt"
	"os"
	"strconv"
	"bufio"
)

var sc = bufio.NewScanner(os.Stdin)

func main(){
	for sc.Scan(){
		n := nextInt()
		cnt := 0
		// 37以上のとき組み合わせは存在しないが省くのめんどくさいのでまとめて計算
		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++
						}
					}
				}
			}
		}
		fmt.Println(cnt)
	}
}

func next()string{
	//sc.Scan()
	return sc.Text()
}

func nextInt()int{
	a, _ := strconv.Atoi(next())
	return a
}

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++;
	cout << ans << endl;
	return 0;
}

C++: #include<iostream>
int main(){int n,a,b,c,d,f=0;while(std::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)f++;std::cout<<f<<"\n";}}

C++: #include<iostream>

int main(void){
  int a,b,c,d,n;
  int i =0;
  std::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(n ==a+b+c+d){
	    i++;
	  }
	}
      }
    }
  }
  std::cout << i << std::endl;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <cctype>

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>


using namespace std;

#define Max INT_MAX
#define Inf (INT_MAX/2)
#define Min INT_MIN


#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i,l,n) for(int (i)=(int)(l);(i)<(int)(n);(i)++)
// s <= x < g ?
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
// 0 <= x < w && 0 <= y < h ?
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))

typedef pair<int, int> P;

int main()
{
    int n;

    while( cin >> n ){
        int count =0;
        if( n == 0 ) { break; }
        for( int a=9; 0 <= a; a-- ){
            for( int b=9; 0<=b; b-- ){
                for( int c=9; 0<=c; c-- ){
                    for( int d=9; 0<=d; d-- ){
                        if( a+b+c+d==n ){
                            count++;
                        }
                    }
                }
            }
        }
        cout << count << endl;
    }
}

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

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

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

int main() {
	int n;

	while (cin >> n) {
		int count = 0;
		
		if (n <= 36) {
			for (int a = 0;a <= n;a++) {
				for (int b = 0;b <= n;b++) {
					for (int c = 0;c <= n;c++) {
						for (int d = 0;d <= n;d++) {
							if (a + b + c + d == n) {
								count++;
							}
						}
					}
				}
			}
		}
		
		cout << count << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int h[51];
int main() {
 int a,b,c,d,n,j=0,m;
 for (m=0; m<10000; m++) {
	 a=m/1000; b=(m-a*1000)/100;
	 c=(m-a*1000-b*100)/10; d=m-a*1000-b*100-c*10;
     h[a+b+c+d]++;
 }
 while(cin >> n) cout << h[n] << endl;
 return 0;

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

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

C++: #include<bits/stdc++.h>

using namespace std;

int main()
{
    int n = 0,a = 0,b = 0,c = 0,d = 0,cnt = 0;
    while(1){
        cin >> n;
        for(int i = 9;i >= 0;i--){
            a = i;
            for(int j = i; j>= 0;j--){
                b = j;
                for(int k = j;k >= 0;k--){
                    c = k;
                    for(int l = k;l >= 0;l--){
                        d = l;
                        if(a + b + c + d == n)cnt += 4;
                    }
                }
            }
        }
        cout << cnt << endl;
    }
}

C++: #include <stdio.h>

int main(void) {
	// your code goes here
	int z, a,b,c,d,ans=0;
	while(scanf("%d",&z)!=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) == z) {
							ans += 1;
						}
					}
				}
			}
		}
				
		printf("%d",ans);
		ans = 0;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <vector>

using namespace std;

int solve(const int n) {
	set< vector<int> > s;
	vector<int> v(4);
	for (v[0] = 0; v[0] < 10; v[0]++)
		for (v[1] = 0; v[1] < 10; v[1]++)
			for (v[2] = 0; v[2] < 10; v[2]++)
				for (v[3] = 0; v[3] < 10; v[3]++) {
					int sum = 0;
					for (int i = 0; i < 4; i++) sum += v[i];
					if (sum == n) {
						s.insert(v);
						break;
					}
				}
	return s.size();
}

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

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

int memo[100][100];

int solve(int n, int p){

  if(!n && !p) return 1;
  if(n < 0 || !p) return 0;
  if(memo[n][p]) return memo[n][p];

  int res = 0;
  for(int i=0;i<10;i++) res += solve(n-i, p-1);

  return memo[n][p] = res;
}

int main(){

  for(int i=0;i<100;i++) solve(i, 4);

  int n;
  while(cin >> n) cout << memo[n][4] << endl;
}

C++: #include <iostream>
#include <vector>
using namespace std;
vector<int> ans;
int ch;
int solute(int k)
{
	int num=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==k)
						num++;
				}
		return num;
}
int main()
{
	while(cin>>ch)
	{
		ans.push_back(ch);
	}
	for(int i=0;i<ans.size();i++)
	{
		cout<<solute(ans[i])<<endl;
	}
    
	
	
	return 0;
}

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

int main() {
  unsigned int input;
  unsigned int count;

  while(cin >> input) {
    count = 0;
    for(int a0=0; a0<10; a0++) {
      for(int a1=0; a1<10; a1++) {
        for(int a2=0; a2<10; a2++ ) {
          for(int a3=0; a3<10; a3++) {
            if(a0+a1+a2+a3==input) {
              count++;
            }
          }
        }
      }
    }
    cout << count << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int n;
		cin >> n;
		if ( cin.eof() )
			break;

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

		cout << kotae << endl;

	}
	return 0;
}