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

using namespace std;
int countSolve(int a,int b,int n);
void solve(int n);

int main() {
	int n;
	while (1) {
		cin >> n ;
		if(cin.eof()) break ;
		solve(n);
	}
	return 0;
}

int countSolve(int a, int b, int n) {
	int x = n-a-b;
	int count = 0, i = 0 , j=0;
	for (i=0; i<10; i++) {
		for (j=0; j<10; j++) {
			if (x == i+j)
				count++;
		}
	 }
	return count;
}

void solve(int n) {
	int count = 0;
	for (int a=0; a<10; a++) {
		for (int b=0; b<10; b++) {
			count += countSolve(a,b,n);
		}
	}
	cout << count << endl;
}

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