Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		count := 0
		for i := 9; i >= 0; i-- {
			numCpy, _ := strconv.Atoi(scanner.Text())
			if numCpy-i >= 0 {
				for j := 9; j >= 0; j-- {
					numCpyi := numCpy - i
					if numCpyi-j >= 0 {
						for k := 9; k >= 0; k-- {
							numCpyj := numCpyi - j
							if numCpyj-k >= 0 {
								for l := 9; l >= 0; l-- {
									numCpyk := numCpyj - k
									if numCpyk-l == 0 {
										count++
										break
									}
								}
							}
						}
					}
				}
			}
		}
		fmt.Println(count)
	}

}

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

int main(){
	int a, b, c, d, n, cnt;
	while(cin >> n){
		cnt = 0;
		for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				for(c=0;c<10;c++){
					for(d=0;d<10;d++){
						if(a+b+c+d == n) cnt++;
					}
				}
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

C++: #include<stdio.h>
 
int main(void){
    int a, b, c, d, n = 0;
    int ans = 0;
     
    while(scanf("%d", &n) != EOF){
        ans = 0;
        if(n <= 36){
            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 ==n){
                                ans++;
                            }
                        }
                    }
                }
            }
            printf("%d\n", ans);
        }else{
            printf("0\n");
        }
    }
    return 0;
}

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

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

int main()
{
	int a, b, c, d, n, iCount;

	while( cin >> n ){
		iCount = 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) == n )
							iCount++;
					}
				}
			}
		}

		cout << iCount << endl;

	}

	cout << iCount << endl;

	return 0;
}

C++: #include<iostream>
#include <cstdio>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int main()

{
    int count=0,n;
    cin>>n;
    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;
}

C++: #include <iostream>
using namespace std;
int main(){
	
	int n;
	while (cin >> n)
	{
		int a, b, c, d, sum = 0;
		for (a = 0; a <10; a++){
			for (b = 0; b < 10; b++){
				for (c = 0; c < 10; c++){
					for (d = 0; d < 10; d++){
						if (a + b + c + d == n){
							sum += 1;
						}
					}
				}
			}
		}
		cout << sum << endl;
	}
	

}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
	while(cin >> n) {
		if(n >= 37) continue;
		int ret = 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) ret++;
					}
				}
			}
		}
		cout << ret << endl;
	}
}

C++: #include <iostream>

using namespace std;

int calc(int a, int b, int n) {
	int tmp = n-a-b;
	int count = 0;
	for (int c=0; c<10; c++) {
		for (int d=0; d<10; d++) {
			if (tmp == c+d)
				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 += calc(a,b,n);
		}
	}
	cout << count << endl;
}

int main() {
	int n;
	while (cin >> n) {
		solve(n);
	}
	return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
    int t, n, res;
    cin >> t;
    for(int i = 0; i < t; i++){
        cin >> n;
        res = 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) res++;
        cout << res << endl;
    }
    return 0;
}

C++: #include<cstdio>

int solve(int a,int b){
	if(a==0){
		if(0<=b&&b<=9)return 1;
		else return 0;
	}
	int res=0;
	for(int i=0;i<10;i++){
		res+=solve(a-1,b-i);
	}
	return res;
}

int main(){
	int a;
	while(~scanf("%d",&a))	printf("%d\n",solve(3,a));
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <functional>
#define rep(i, n) for(int i = 0; i < n; i++)
#define ll long long
using namespace std;


int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    int n;
    while(cin >> n) {
        int cnt = 0;
        rep(a, 10) {
            rep(b, 10) {
                rep(c, 10) {
                    rep(d, 10) {
                        if (a + b + c + d == n) {
                            cnt++;
                        }
                    }
                }
            }
        }
        cout << cnt << "\n";
    }
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n;
    

    while (cin >> n) {
        int ans = 0;
        for (int i1 = 0; i1 < 10; i1++) {
            for (int i2 = 0; i2 < 10; i2++)
                for (int i3 = 0; i3 < 10; i3++)
                    for (int i4 = 0; i4 < 10; i4++)
                        if (i1 + i2 + i3 + i4 == n)
                            ans++;
        }
        cout << ans << endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int n,cont;
  while(scanf("%d",&n)!=EOF){
    cont=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)cont++;
	  }
	}
      }
    }
    cout<<cont<<endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
int main() {
	int a,b,c,d,n,count=0;
	while(cin>>n){
		if(n>36){
			cout<<0<<endl;
		}
		else{
			for(a=0;a<10;a++){
				for(b=0;b<10;b++){
					for(c=0;c<10;c++){
						for(d=0;d<10;d++){
							if(a+b+c+d==n){
								count++;
							}
						}
					}
				}
			}
			cout<<count<<endl;
		}
		count=0;
	}
}

C++: #include<iostream>
using namespace std;
int x,ans;
int main(){
while(1){
ans=0;
cin>>x;
for(int i=0;i<10;i++){
for(int j=0;i<10;j++){
for(int k=0;k<10;k++){
if(x-i+j+k<10){
ans++;
}

}
}
}
cout<<ans;
}
}

C++: #include<stdio.h>

int main(void){

	int a,b,c,d,n,count,i,j,k;

	while(1){
	
		scanf("%d",&n);
	
		if(n>50||n<=0){
			break;
		}
	
		count=0;
	
		for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				for(c=0;c<10;c++){
					for(d=0;d<10;d++){
					
						if(n==a+b+c+d){
							count++;
						}
					}
				}
			}
		}

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