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<iostream>

using namespace std;

int main()
{
	int input;
	cin >> input;
	
	short count = 0;
	int i, j, k, l;
	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 == input)	count++;
				}
			}
		}
	}
	cout << count << endl;
	
	return 0;
}

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

C++: #include <stdio.h>

int main(void)
{
	int n;
	int i, j, k, l;
	int ans = 0;
		
	while(scanf("%d", &n) != EOF){
			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 == n){ ans += 1; }
						}
					}
				}
			}
			
			printf("%d\n", ans);
		}
		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<=9) count = ((n+1)*(n+2)*(n+3))/6;
		else if (n<=18) count = ((n+1)*(n+2)*(n+3))/6 - 4*((n-9)*(n-8)*(n-7))/6;
		else if (n<=27) count = ((37-n)*(38-n)*(39-n))/6 - 4*((27-n)*(28-n)*(29-n))/6;
		else count = ((37-n)*(38-n)*(39-n))/6;
		
		cout << count << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
int main(){

	int a,b,c,d,n,i;

	while(std::cin>>n&&n){
	i=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){
						i++;
			

						}
					}
				}
			}
		}

	std::cout<<i<<std::endl;
}
	return 0;
	}

C++: #include<iostream>
#include<cmath>
#include<cstdio>

using namespace std;

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

	cin >> 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(a + b + c + d == n)
									ans ++;
							}
					}
			}
	}

	cout << ans << endl;

	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;
				else
					count += 24;
				}
			}
		}
		cout << count << endl;

	}

	return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: #include <stdlib.h>

int main()
{
    int n,a,b,c,d,i,j,k,l,cnt=0;
    scanf("%d",&n);
    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)
                        cnt=cnt+1;
                    else
                        continue;
                }
            }
        }
    }
    printf("%d\n",cnt);
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int cnt = 0;
    for (int i = 0; i = 10; i++) {
      for (int j = 0; j = 10; j++) {
        for (int k = 0; k = 10; k++) {
          if (0 <= n - i - j - k && n - i - j - k < 10) cnt++;
        }
      }
    }
    cout << cnt << endl;
  }
}

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

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

using namespace std;

int n, s;
int dp[10][100][10];
int solve(int i, int j, int k);

int main(void){
	
	while(cin >> n >> s){
		if(n == 0 && s == 0){break;}
		fill_n(**dp,10*100*10,-1);
		cout << solve(0,0,10) << endl;
	}
}

int solve(int now, int sum, int b1){
	if(now == n){
		if(sum == s){return 1;}
		else return 0;
	}
	if(dp[now][sum][b1] != -1){return dp[now][sum][b1];}
	int t = 0;
	for(int i = 0; i < 10; i++){
		if(b1 != 10 && b1 >= i){break;}
		t += solve(now+1, sum + i, i);
	}
	return dp[now][sum][b1] = t;
}

C++: #include <cstdio>

using namespace std;
 
int main() {
	int n;
	int i, j, k, m;
	int counter;
	
	while (scanf("%d", &n) != EOF) {
	    counter = 0;
	    
	    for (i = 0; i < 10; i++) {
	        for (j = 0; j < 10; j++) {
	            for (k = 0; k < 10; k++) {
	                for (m = 0; m < 10; m++) {
	                    if ((i + j + k + m) == n) counter++;
	                }
	            }
	        }
	    }
	    
	    printf("%d\n", counter);
	}
	
	return 0;
}

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

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

int a,b,x;

int mySet(int d){
  for(int i=0;i<10;i++){
    if(d<3){
      mySet(d+1);
    }else if(d==3){
      if(a==x){
      b++;
      }
    }
    a++;
  }
  return a=a-10;
}

int main(void){
  cin>>x;
  mySet(0);
  cout<<b<<endl;
  return 0;
}

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

int num, ans = 0;
int ary[MAX] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

void dfs(int sum, int count) 
{
	if (count == 4 || sum == num) {
		if (sum == num) ans++;
	}else {
		for (int j = 0; j < MAX; j++) {
			dfs(sum+ary[j], count+1);
		}
	}
}

int main(void)
{
	while (cin >> num) {
		ans = 0;
		dfs(0, 0);
		cout << ans << endl;
	}
	
	return 0;
}