Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include <stdio.h>
using namespace std;

int main(void) {
  int sum;
  while (scanf("%d", &sum)+1) {
    if (sum > 36) return 0;

    int count = 0;
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 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) == sum) count++;
          }
        }
      }
    }
    printf("%d\n", count);
  }
}

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

using namespace std;

int main (void) {
	int n, MAX = 9, c;
	
	while (scanf("%d", &n) != EOF) {
		c = 0;
		
		for (int a = 0; a <= MAX; a ++) {
			for (int b = 0; b <= MAX; b ++) {
				for (int c = 0; c <= MAX; c ++) {
					for (int d = 0; d <= MAX; d ++) {
						if (a + b + c + d == n) {
							c ++;
						}
					}
				}
			}
		}
		
		cout << c << endl;
	}
	
	return 0;
}

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

int resolve(int input)
{
	int result = 0;
	int max_a = std::min(9, input);
	for (int a = 0; a <= max_a; ++a) {
		int max_b = std::min(9, input - a);
		for (int b = 0; b <= max_b; ++b) {
			int max_c = std::min(9, input - a - b);
			for (int c = 0; c <= max_c; ++c) {
				int d = input - a - b - c;
				if (0 <= d && d <= 9) {
					++result;
				}
			}
		}
	}
	return result;
}

int main()
{
	int input;
	while (std::cin >> input) {
		std::cout << resolve(input) << std::endl;
	}

	return 0;
}

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

int countsum(int& n)
{
    static int a, b, c, d;
    static int count;
    count = 0;
    for(a=0; a < 10; a++)
    {
        if(a > n) break;
        for(b=0; b < 10; b++)
        {
            if(a + b > n) break;
            for(c=0; c < 10; c++)
            {
                if(a + b + c > n) break;
                for(d=0; d < 10; d++)
                {
                    if(a + b + c + d > n) break;
                    if(a + b + c + d == n) count++;
                }

            }
            
        }
        
    }

    return count;
}

int main()
{
    int n;
    while(cin >> n)
    {
        cout << countsum(n) << endl;
    }
    return EXIT_SUCCESS;
}

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

int main()
{
	int n, cnt;

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

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

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

	return 0;
}

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

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

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

int main()
{
	int n,c;

	while(cin >> n){
		c = 0;
		if(n < 37){
			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)
								++c;
						}
					}
				}
			}

			cout << c << endl;

		}else{
			cout << 0 << endl;
		}

	}
	return 0;
}

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

int main() {
	int n;
	while(cin>>n)
	{
		int c=0;
		for(int i=0;i<10;i++)
		for(int j=0;j<10;j++)
		for(int k=0;k<10;k++)
		if(n-i-j-k>=0&&n-i-j-k<10)c++;
		cout<<c<<endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main(){
    int n,cnt = 0;
    int a,b,c,d;
    while(scanf("%d",&n)!=EOF){
        if(n<37){
            for(a=0;a<10&&a<=n;a++){
                for(b=0;b<10&&a+b<=n;b++){
                    for(c=0;c<10&&a+b+c<=n;c++){
                        d = n-a-b-c;
                        if(d<10)cnt++;
                    }
                }
            }
        }
        printf("%d\n",cnt);
    }
}

C++: import java.util.Scanner;
public class Main { 
  public static void main(String[] args){
	  int count=0;
	  int a=0;
	  Scanner sc = new Scanner(System.in);
			//  int n = sc.nextInt();
	  for (int i = 0;i<=9;i++) {
          int n = sc.nextInt();
		  for(int j = 0;j<=9;j++) {
			  for(int k =0;k<=9;k++) {
				  for(int l = 0;l<=9;l++) {
					  a = i + j + k + l;
					  if(a==n) count++;
				  }
			  }
		  }
		  
	  }
	  System.out.println(count);
  
  }
}

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

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

C++: #include <iostream>

using namespace std;

#define rep(i,n) for(int i = 0;i < n;i++)

int main(){
 int n;
 while(cin >> n){
  int ans = 0;
  rep(i,10)rep(j,10)rep(k,10)rep(l,10){
   if(i + j + k + l == n){
    ans++;
   }
  }
 }
 cout << ans << 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; 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 < 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>

int n,ans;

int sum(){
	ans = 0;
	int a=0,b=0,c=0,d=0;
	for(;a<10;a++){
		for(;b<10;b++){
			for(;c<10;c++){
				for(;d<10;d++)
					if(a+b+c+d==n)
						ans++;
				d=0;
			}
			c=0;
		}
		b=0;
	}
	return ans;
}

int main(){
	while(std::cin >> n)
		std::cout << sum() << std::endl;
	return 0;
}

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

int main()
{
	int n;
	int 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 << "\n";
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

bool testcase_ends() {
    int n;
    if (scanf("%d", &n) == EOF)
        return 1;

    int res=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)
                        ++res;

    printf("%d\n", res);
    return 0;
}

int main() {
    bool solved_one=false;
    while (!testcase_ends())
        solved_one |= true;

    return !solved_one;
}