Go: package main

import (
  "fmt"
)

func main() {
  var a int
  var b int
  for _, err := fmt.Scan(&a); err == nil; _, err = fmt.Scan(&a) {
    b = 0
    for i:=0; i<10; i++ {
      for j:=0; j<10; j++ {
        for k:=0; k<10; k++ {
          for l:=0; l<10; l++ {
            if (i+j+k+l == a) {
              b++
            }
          }
        }
      }
    }
  fmt.Println(b)
  }
}

C++: #include<stdio.h>

int main(void)
{
	int a,b,c,d,i=0,j;
	int kai[1000]={0},atai[1000];
	while(kai[0] ==0)
	{
		scanf("%d",&atai[i]);
		
		if(atai[i]<0 || 50<atai[i])break;

		i=i+1;
	}
	
	for(j=0;j<i;j++)
	{
		for(a=0;a<10;a++)
		{
			if(a>atai[j])break;
			for(b=0;b<10;b++)
			{
				if(a+b > atai[j])break;
				for(c=0;c<10;c++)
				{
					if(a+b+c>atai[j])break;
					for(d=0;d<10;d++)
					{
						if(a+b+c+d == atai[j])
						{
							kai[j]=kai[j]+1;
						}
						else if(a+b+c+d>atai[j])break;
					}
				}
			}
		}
	  printf("%d\n",kai[j]);
	}
	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;
	while(cin >> n)
	cout << seach(n,0) << endl;
	return 0;
}

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

void calc(std::vector<int> &v) {
    std::vector<int> g(10, 0);
    for (int i = 1; i <= 9; i++) {
        v[i] = 4 * i; 
    }
    for (int i = 0; i <= 9; i++) {
        g[i + 9] = 3 * i;
    }
    for (int i = 1; i <= 9; i++) {
        v[i + 9] = g[i + 8] * 3 + (v[i + 8] - g[i + 8]);
    }
    return; 
}

int main(void) {
    std::vector<int> v(19, 0);
    calc(v);
    int total;

    while (std::cin >> total) {
        if (total > 36) {
            std::cout << '0' << std::endl;
        } else if (total > 18){
            total = 36 - total; 
            std::cout << v[total] << std::endl;
        } else {
            std::cout << v[total] << std::endl;
        }
    }
    return 0;
}

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

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

int main(){
	int a;
	while(cin >> a){
		int counter = 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)
							counter++;
		cout << counter << endl;
	}
}

C++: #include <cstdio>

using namespace std;

int main()
{
  int n;
  while (scanf(" %d ", &n) == 1) {
    int c = 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) {c++;}
	  }
	}
      }
    }
    printf("%d\n", c);
  }
}

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

int main(void){
  int dp[50][4];
  for(int i = 0; i < 50; i++){
    for(int j = 0; i < 4; j++){
      if(i < 10 && j = 0)
	dp[i][j] = 1;
      else
	dp[i][j] = 0;
    }
  }
  
  for(int i = 1; i < 4; i++){
    for(int j = 0; j < 10; j++){
      for(int k = 0; k < 36; k++){
	if(k - j >= 0){
	  dp[k][i] += dp[k - j][i - 1];
	}
      }
    }
  }
  
  int n;
  while(cin >> n){
    cout << dp[n][3] << endl;
  }
  return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{   
    int x;
    int i;
    int a, b, c, d;
    while (scanf("%d", &x) != EOF) {
        i = 0;
        a = 9;
        b = 9;
        c = 9;
        d = 9;
        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) == x) {
                            i += 1;
                        }
                    }
                }
            }
        }
        printf("%d\n", i);
    }
    return 0;
}

C++: #include<iostream>

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

	std::cin>>n;

	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++;
				}
			}
		}
	}

	std::cout<<ans;
	return 0;
}

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++) {
                    if(a+b+c+d == n) {
                        count++;
                    }
                }
            }
        }
    }
    cout<<count;
    return 0;
}

C++: #include <iostream>

void 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 <bits/stdc++.h>

using namespace std;

#define llong long long 
int n;
int ans;
bool memo[1001];

void solve(int num, int sum, int d){
	if(d == 4){
		if(sum == num){
			ans++;			
		}
		return;
	}

	if(num < sum) return;

	for(int i = 0;i <= 9; i++){
		solve(num, sum + i, d + 1);
	}
	return;
}

int main(){
	while(cin >> n){
		ans = 0;
		solve(n, 0, 0);
		cout << ans << endl;
	}

	return 0;
}

C++: #include <math.h>
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"
#define space ' '

using namespace std;

void func();

int main(void)
{
	
	func();

	return 0;
}


void func()
{
	int n, cnt = 0;

	while (cin >> n, !cin.eof()){


		for (int i = 0; i++ < 9;)
		{
			for (int ii = 0; ii++ < 9;)
			{
				for (int iii = 0; iii++ < 9;)
				{
					for (int iiii = 0; iiii++ < 9;)
					{
						if (i + ii + iii + iiii == n)
							cnt++;

					}
				}
			}
		}

		cout << cnt << endl;
	}
}

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

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

		cout << ways << endl;
	}
}

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>

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

	while (std::cin >> n) {
		m = 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) {
							++m;
						}
					}
				}
			}
		}
		std::cout << m << std::endl;
	}
	return 0;
}

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

int sum( int num ){

  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++ ){
	  if( a+b+c+d == num ){
	    count++;
	  }
	}
      }
    }
  }

  return count;

}

int main(){

  int num;

  while( cin >> num ){
    cout << sum(num) << endl;
  } 

  return 0;
}

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

int main(void){

	while (true){
		int n, count=0;
		cin>>n;
		if (cin.eof()) break;	
		for (int i1=0; i1<10; i1++){
			int n1 = n-i1;
			if (n1 < 0 || n1 > 27) continue;
			for (int i2=0; i2<10; i2++){
				int n2 = n1 - i2;
				if (n2 < 0 || n2 > 18) continue;
				for (int i3=0; i3<10; i3++){
					int n3 = n2 - i3;
					if (n3<0 || n3>9) continue;
					count++;
				}
			}
		}
		cout<<count<<endl;
	}
	return 0;
}