Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 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 {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

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

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

int main(){
	int root[5][51], i, j;
	for (i = 0; i < 5; i++) {
		for (j = 0; j < 51; j++)
			root[i][j] = 0;
	}
	for (i = 0; i < 10; i++) {
		root[1][i] = 1;
	}
	for (i = 1; i < 5; i++) {
		root[i][0] = 1;
	}
	for (i = 2; i < 5; i++) {
		for (j = 1; j < 51; j++) {
			for (int k = j; k >= 0 && k > j - 10; k--) {
				root[i][j] += root[i - 1][k];
			}
		}
	}
	while (true) {
		int n;
		cin >> n;
		if (cin.eof()){
			break;
		}
		cout << root[4][n] << endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;
#define RENT 100000
int main(){
	int n, ans;
	int counter = 0;
	while (cin >> n){
		counter = 0;
		for (int i = 0; i < 10; i++){
			for (int q = 0; q < 10; q++){
				for (int w = 0; w < 10; w++){
					for (int e = 0; e < 10; e++){
						ans = i + q + w + e;
						if (ans == n){
							counter += 1;
						}
					}
				}
			}
		}
		cout << counter << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>

using namespace std;





int main()
{
	int n;
	int sum;
	int k[19];//k[i]???i?????????????¶?????????§??????????????¨?????????????????????
	while (cin >> n) {
		sum = 0;
		if (n > 36) {
			cout << "0" << endl;
		}
		else{
			
			for (int i = 0; i < 19; i++) {
				if (i < 10) {
					k[i] = i + 1;
				}
				else {
					k[i] = 19 - i;
				}
			}
			for (int i = max({0,n-18}); i <= min({ 18,n }); i++) {
				sum += k[i] * k[n - i];
			}
			cout << sum << endl;
		}
		
	}





}

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

int main() {
	// your code goes here
	int n;
	while(cin>>n){
	int count=0;
	if(n>36){cout<<0<<endl;}else{
		for(int i=9; i>=0; i--){
			for(int j=i; j>=0; j--){
				for(int k=j; k>=0; j--){
					for(int l=k; l>=0; l--){
						if(i+j+k+l==n)count++;
					}
				}
			}
		}
		cout<<count<<endl;
	}
	}
	return 0;
}

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



int main(){
    int n,cnt;
    int num[10000],i=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++){
                    num[i]=a+b+c+d;
                    i++;
                }
    
    while(cin >> n){
        cnt = 0;
        for(int j=0;j<10000;j++){
            if(n==num[j]) cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>
 
using namespace std;
 
 
// cin >>
// cout <<
int main(){
    int in=0;
	int out;
    while(scanf("%d",&in)!=EOF){
    out=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==in){
						out++;  
						}   
					}
				}
			}
		}
		printf("%d\n",out);
    }
    
     
    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>
using namespace std;

int main()
{
	int n = 0;
	int upper =10;
	while(cin >> n){
		int answer = 0;
		for(int i = 0; i < upper; ++i)
		{
			for(int j = 0; j < upper; ++j)
			{
				for(int k = 0; k < upper;++k)
				{
					for(int l = 0; l < upper; ++l)
					{
						if((i+j+k+l)==n)
						{
							answer++;
						}
					}
				}
			}
		}
		cout << answer << 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 - 1] = 3 * i;
    }
    for (int i = 1; i <= 9; i++) {
        v[i + 9] = g[i - 1] * 3 + (v[i + 8] - g[i - 1]);
    }
    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<cstdio>

int main(){
	int n, count = 0;

	while(scanf("%d", &n) + 1){
		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(n == i + j + k + l){
							count++;
						}
					}
				}
			}
		}
		printf("%d\n", count);
	}
}

C++: #include <iostream>


int func(int 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++;
					}
				}
			}
		}
	}

	return count;
}



int main(){
	int input;

	while (true){
		if (std::cin >> input){
			std::cout << func(input) << "\n";
		}
	}
	
	return 0;
}