Go: package main

import "fmt"

var count int

func main() {
	var inputNum int
	for {
		fmt.Scanf("%d", &inputNum)
		fmt.Printf("%d\n", calcA(inputNum))
		count = 0
	}
}

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>
using namespace std;

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

C++: #include <iostream>

using namespace std;


int main()
{

	int n,count;
	int a,b, c,d;
	while(cin >> n){

		//a>=b>=c>=dと仮定
		count = 0;
		for( a = 0; a < 10; a++ ) {
			if ( a > n ) 
				continue;
			for( b = 0; b < a+1; b++ ) {
				if( a + b > n )
					continue;
				for( c = 0; c < b+1; c++ ) {
					if( a + b + c > n ) 
						continue;
					d = n - a - b- c;
					if( d > c )
						continue;
				if( a == d )//全部同じ
					count += 1;
				else if( a == c || b == d)//１つ異なる
					count += 4;
				else if( a == b && c == d )//2つずつ同じ
					count += 6;
				else if( a == b || b == c || c == d )//2つ同じ
					count += 12;
				}
			}
		}
		cout << count << endl;

	}

	return 0;
}

C++: #include<cstdio>

int main(){

    int n;

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

    return 0;
}

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

int main()
{
	int a;
	while(cin>>a)
	{
	cin>>a;
	int b =0;
	for(int c=0;c<10;c++)
		for(int d =0;d<10;d++)
			for(int e =0;e<10;e++)
				for(int f =0;f<10;f++)
				{
					if
						(c+d+e+f==a)
						b=b+1;
				}
				cout<<b<<endl;
}
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
	string str = "";

	while (getline (cin, str)){
		int n = 0;
		int res = 0;
		stringstream ss(str);
		ss >> n;
		for (int i = 0; i < 10000; ++i){
			int a = i/1000;
			int b = (i/100) % 10;
			int c = (i/10) % 10;
			int d = i % 10;
			
			if (a + b + c + d == n){
				++res;
			} // end if
		} // end for
		cout << res << endl;	
	} // end while

	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 << "\n"; } return 0; }

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

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

C++: #include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
using namespace std;

int main(){
	int n;
	while (cin >> n) {
		int dp[4][51] = {}; //abcd, n
		for (int i = 0; i <= 9; ++i) {
			dp[0][i] = 1;
		}
		for (int i = 1; i < 4; ++i) {
			for (int j = 0; j < 50; ++j) {
				for (int k = 0; k <= 9; ++k) {
					dp[i][j+k] += dp[i-1][j];
				}
			}
		}
		cout << dp[3][n] << endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main() {
    int a,b,c,d,RideBack[55];for (a=0;a<=50;RideBack[a++]=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++) RideBack[a+b+c+d]++;
    while (scanf("%d",&a)!=EOF) printf("%d\n",RideBack[a]);return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,j,k,d,c;
	while(scanf("%d",&n)!=EOF){
		c=0;
		for(i=0;i<10;i++){
			for(j=0;j<10;j++){
				for(k=0;k<10;k++){
					for(d=0;d<10;d++){
						if(i+j+k+d==n){
							c++;
						}
					}
				}
			}
		}
		printf("%d\n",c);	
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

#define MAX 256

int miku(int x){
	if(x > 36)return 0;
	if(x < 10)return (x + 3)*(x + 2)*(x + 1) / 6;
	if(x > 18)return miku(36 - x);
	if(x > 9 && x < 19)return (x + 3)*(x + 2)*(x + 1) / 6 - (miku(x - 10) * 4);
}

int main(void){
	int n,i = 0;
	int ans[MAX];
	
	while(cin >> n){
		ans[i] = miku(n);
		i++;
	}
	
	for(int j = 0;j < i;j++){
		cout << ans [j] <<endl;
	}

	return 0;
}

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

int main(void){
  int dp[50][4];
  for(int i = 0; i < 50; i++){
    for(int j = 0; j < 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 < 37; 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<iostream>

using namespace std;

int main(){
	int n;

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

					}	
				}	
			}
		}
		cout << result << endl;
	}

	return 0;
}

C++: #include<stdio.h>

int main(void){
	int n,ans=0;
	scanf_s("%d",&n);
	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))
						ans++;
				}
			}
		}
	}
	printf("%d",ans);
	return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
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>
#include<cstdio>
#include<algorithm>
using namespace std;

int n;

int forf(int cnt,int t){
    if(cnt==0){
        if(cnt==n){
            return 1;
        }else{
            return 0;
        }
    }else{
        int tt=0;
        for(int i=0;i<10;i++){
            tt=forf(cnt-1,t+i);
        }
        return tt;
    }
}

int main(){
    while(scanf(" %d",&n)){
        cout << forf(4,0) << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int x,ans;
int main(){
while(1){
ans=0;
if(!(cin>>x)) return 0;

for(int i=0;i<10;i++){
for(int j=0;i<10;j++){
for(int k=0;k<10;k++){
if(x-i+j+k<10){
ans++;
}

}
}
}
cout<<ans;
}
}

C++: #include <iostream>
using namespace std;
int main(void)
{
  int n;
  int a, b, c, d;
  int com;

  while(cin >> n)
    {
      com = 0;
      if(n == EOF) break;
      
      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) com++;
		    }
		}
	    }
	}
      cout << com << endl;
    }
  return 0;
}