Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		if inputCount == 50 {
			break
		}
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
		count = 0
	}
	for _, v := range resultArr {
		fmt.Printf("%d\n", v)
	}
}

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() {
    int n,i,j,k,l,ans;

    while(cin >> n){

        ans = 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(n == i + j + k + l){
                            ans++;
                        }
                    }
                }
            }
        }
        
        cout << ans << endl;
    }
    
    return 0;
}

C++: 
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>





using namespace std;


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

	cin >> num;

	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 == num)
						count++;
				}
			}
		}
	}

	cout << count << endl;

}

C++: #include<stdio.h>

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

int main(int argc, char *argv[]) {
	using namespace std;
	
	int rcv;
	
	while (EOF != fscanf(stdin, "%d", &rcv)) {
		int cnt = 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 == rcv)
							cnt++;
					}
				}
			}
		}
		printf("%d\n", cnt);
	}
	return 0;
}

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

int main(void)
{
  int e=0,n=0;
  while(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){
         e +=1;
         }
        }
      }
    }
  }
  cout << e << endl;
  e = 0;
 }
}

C++: #include <bits/stdc++.h>
using namespace std;
int memo[51];

int main()
{
    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++)
                {
                    memo[a + b + c + d]++;
                }
            }
        }
    }
    int n;
    while (cin >> n)
    {
        cout << memo[n] << endl;
    }
}

C++: #include<iostream>
#include<cstring>
#define rep(i,a) for(i=0;i<=a;++i)
using namespace std;

int main(){
    int n,i,j,k,l,cnt;
    while(cin>>n){
        cnt = 0;
        rep(i,9)rep(j,9)rep(k,9){
            l=n-(i+j+k);
            if(l>=0 && l<=9)cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

C++: #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#define mid (l+r>>1)
#define lc (o<<1)
#define rc (o<<1|1)
using namespace std;
const int maxn = 1000010;

int sumv[maxn*4], st[maxn*4], ql, qr, v, _sum;
int n, ans[100], top;

void insert1(int o, int l, int r)
{
    if(ql <= l && r <= qr) {
        sumv[o] = st[o] = 1<<v;
        return;
    }
    if(st[o]) {
        st[lc] = st[rc] = st[o];
        sumv[lc] = sumv[rc] = st[o];
        st[o] = 0;
    }
    int m = mid;
    if(ql <= m) insert1(lc, l, m);
    if(qr >  m) insert1(rc, m+1, r);
    sumv[o] = sumv[lc] | sumv[rc];
    //printf("%d %d %d\n", l, r, sumv[o]);
}

void query(int o, int l, int r)
{
    if(st[o]) {
        _sum |= st[o];
        return;
    }
    if(ql <= l && r <= qr) {
        _sum |= sumv[o];
        return;
    }
    int m = mid;
    if(ql <= m) query(lc, l, m);
    if(qr >  m) query(rc, m+1, r);
}

int gao(int s)
{
    int i = 0;
    top = 0;
    while(s) {
        i++;
        if(s&1) ans[top++] = i;
        s >>= 1;
    }
}

int main()
{
    //freopen("b.txt", "r", stdin);
    //freopen("bout", "w", stdout);
    int m;
    while(scanf("%d%d", &n, &m), n)
    {
        //printf("%d %d\n", n, m);
        if(n == 0) break;
        memset(sumv, 0, sizeof sumv);
        memset(st, 0, sizeof st);
        char op[3];
        for(int i = 0; i < m; i++)
        {
            scanf("%s", op);
            if(op[0] == 'P') {
                scanf("%d%d%d", &ql, &qr, &v); v--;
                insert1(1, 1, n);
                //puts("");
            } else {
                scanf("%d%d", &ql, &qr);
                _sum = 0;
                query(1, 1, n);
                gao(_sum);
                for(int i = 0; i < top; i++) {
                    printf("%d%c", ans[i], i==top-1 ? '\n':' ');
                }
            }
        }
    }
    return 0;
}

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; k--){
					for(int l=k; l>=0; l--){
						if(i+j+k+l==n)count++;
					}
				}
			}
		}
		cout<<count<<endl;
	}
	}
	return 0;
}

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n;
	while(cin>>n){
		int 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;
					}
				}
			}
		}
		cout<<ans<<"\n"s;
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
int n,S;
int a[4];
while(cin>>n,n<50)
{
a[0]=0;
a[1]=0;
a[2]=0;
a[3]=0;
for(int i=0;i<10;i++)
{
	a[0]=i;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	for(int j=0;j<10;j++)
{
	a[1]=j;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
for(int k=0;k<10;k++)
{
	a[2]=k;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	for(int l=0;l<10;l++)
{
	a[3]=l;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	
}
}	
}
}	
}
cout<<S<<endl;
return 0;
}

C++: #include <iostream>

int main(void)
{
	int16_t a = 0;
	int16_t b = 0;
	int16_t c = 0;
	int16_t d = 0;
	int16_t n = 0;
	int16_t count = 0;

	while (std::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++;
						}
					}
				}
			}
		}
		std::cout << count << std::endl;
	}

	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int n, iCount;

	scanf("%d",&n);

	iCount = 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 )
						iCount++;
				}
			}
		}
	}

	printf("%d\n",iCount);

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n, i, j, k, l, C = 0;
	while (cin >> n){
		for (i = 1; i < 10; i++){
			for (j = 1; j < 10; j++){
				for (k = 1; k < 10; k++){
					for (l = 1; l < 10; l++){
						if (n == i + j + k + l){
							C = C+1;
						}
					}
				}
			}
		}
	}
	cout << C << endl;
	return 0;
}