Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
	}
	for _, value := range resultArr {
		fmt.Println(value)
	}
}

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(void)
{
	int n;
	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<algorithm>
#include<cstdio>
using namespace std;

int main(){
  char s[10];
  int n;
  int ans=0;
  
  while(1){
    scanf(" %s",s);
    if(s[0]==EOF)break;
    n=atoi(s);
    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 <stdio.h>

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

C++: #include <cstdio>
#include <cstring>

using namespace std;

int res[64];

int main()
{
  int n;
  memset(res, 0, sizeof res);

  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++)
	  res[a+b+c+d]++;
  
  while(scanf("%d", &n) != -1)
    printf("%d\n", res[n]);

  return 0;
}

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

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

  cout << cou << "\n";
  }

  return 0;
}

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

int main()
{
    int n,a,x=0;
    while(cin>>n)
    {
        for(int i=0;i<9;i++){
            for(int j=0;j<9;j++){
                for(int k=0;k<9;k++){
                    a=n-i-j-k;
                    if(a>=0&&a<=9)
                        x++;
                }
            }
        }
        cout<<x<<endl;
    }
    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 <= 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) {
              cnt++;
            }
          }
        }
      }
    }
    cout << cnt << endl;
  }
}

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

C++: #include<iostream>

using namespace std;

int main(){
  int n,sum[50]={0},i=0;
  while(cin >> n){
    if(n >= 37){
      sum[i] = 0;
      i++;
    }
    else{
      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) sum[i]++;
	    }	    
	  }
	}
      }
      i++;
    }
  }
  int j;
  for(j = 0; j <= i; j++) cout << sum[j] << endl;
}

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

int main()
{
	int n;
	int count = 0;
	vector<int> result;

	while (cin >> n) {
		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++;
		result.push_back(count);
	}

	for(int j=0;j<result.size();j++)
		cout << result[j] << endl;

	return 0;
}

C++: #include <iostream>

int main() {
	using namespace std;
	for (;;) {
		int n;
		cin >> n;
		if (cin.eof()) { break; }

		int pair = 0;
		for (int a = 0; a <= 9; ++a) {
			for (int b = 0; b <= 9; ++b) {
				int ab = a + b;
				for (int c = 0; c <= 9; ++c) {
					int abc = ab + c;
					for (int d = 0; d <= 9; ++d) {
						if (abc + d == n) { ++pair; }
					}
				}
			}
		}

		cout << pair << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
  int i,j,k,l,cou,n;
  while(scanf("%d",&n)!=EOF){
    cou=0;
    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)cou++;
	  }
	}
      }
    }
    printf("%d\n",cou);
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans;
	cin>>n;
	for(a=0;a<min(10,n);a++){
		k = n-a;
		for(b=0;b<min(10,k);b++){
			l = k-b;
			for(c=0;c<min(10,l);c++){
				m = l-c;
				for(d=0;d<min(10,m);d++){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

C++: #include <iostream>

using namespace std;

int main(){

	int n;
	int a , b , c , d;
	int ans , count = 0;

	while(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++){

						ans = a + b + c + d;
						if(ans == n){
							count++;
						}
					}
				}
			}
		}
	}

	cout << count << endl;

	return 0;
}

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

int main()
{
	int n,a,b,cnt=0;
	cin >> n;
	for(a=0;a<=18;a++){
		for(b=0;b<=18;b++){
			if(a+b==n) cnt+= (10-(int)abs(a-9)) * (10-(int)abs(b-9));
		}
	}
	cout << cnt << endl;
	return 0;	
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;


int main()
{
	int n, counter = 0;
		while (scanf("%d", n) == -1){
		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) counter++;
					}
				}
			}
		}
		cout << counter << endl;
	}
	return 0;
}

C++: #include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	
	scanf("%d", &n);
	
	for (i = 0; i < 10; i++){
		for (j = 0; j < 10; j++){
			for (k = 0; k < 10; k++){
				for (h = 0; h < 10; h++){
					if (i + j + k + h == n){
						sum++;
					}
				}
			}
		}
	}
	
	printf("%d\n", sum);
	
	return (0);
}

C++: #include<stdio.h>
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int count=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(n==i+j+k+l)
                            count++;
        printf("%d\n",count);
    }
    return 0;
}

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

int ans = 0;

void SofI(int num, int n) {
	if (num > n * 9) { return; }
	else if (num < 0) { return; }
	else if (num != 0 && n == 0) { return; }
	else if (num == 0) {
		ans++;
		return;
	}
	else {
		for (int i = 0; i < 10; i++) {
			SofI(num - i, n - 1);
		}
	}

}

int main(void) {
	int num;
	cin >> num;
	SofI(num, 4);
	cout << ans << endl;
	return 0;
}