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 table[36 + 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) {
		    ++table[a + b + c + d];
		}
	    }
	}
    }
    int in;
    while (cin >> in) {
	if (0 <= in && in <= 36)
	    cout << table[in] << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n, ans = 0;
	cin >> n;
	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 << endl;
	return 0;
}

C++: #include<iostream>
int main(){int n,a,b,c,d,f=0;while(std::cin>>n){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)f++;std::cout<<f<<"\n";}}

C++: #include<iostream>

int main(void){
  int a,b,c,d,n;
  int i =0;
  std::cin >> n;
  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){
	    i++;
	  }
	}
      }
    }
  }
  std::cout << i << std::endl;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <cctype>

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>


using namespace std;

#define Max INT_MAX
#define Inf (INT_MAX/2)
#define Min INT_MIN


#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i,l,n) for(int (i)=(int)(l);(i)<(int)(n);(i)++)
// s <= x < g ?
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
// 0 <= x < w && 0 <= y < h ?
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))

typedef pair<int, int> P;

int main()
{
    int n;

    while( cin >> n ){
        int count =0;
        if( n == 0 ) { break; }
        for( int a=9; 0 <= a; a-- ){
            for( int b=9; 0<=b; b-- ){
                for( int c=9; 0<=c; c-- ){
                    for( int d=9; 0<=d; d-- ){
                        if( a+b+c+d==n ){
                            count++;
                        }
                    }
                }
            }
        }
        cout << count << endl;
    }
}

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

C++: #include <iostream>
using namespace std;
int memo[51];

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

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

int main() {
	int n;

	while (cin >> n) {
		int count = 0;
		
		if (n <= 36) {
			for (int a = 0;a <= n;a++) {
				for (int b = 0;b <= n;b++) {
					for (int c = 0;c <= n;c++) {
						for (int d = 0;d <= n;d++) {
							if (a + b + c + d == n) {
								count++;
							}
						}
					}
				}
			}
		}
		
		cout << count << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int h[51];
int main() {
 int a,b,c,d,n,j=0,m;
 for (m=0; m<10000; m++) {
	 a=m/1000; b=(m-a*1000)/100;
	 c=(m-a*1000-b*100)/10; d=m-a*1000-b*100-c*10;
     h[a+b+c+d]++;
 }
 while(cin >> n) cout << h[n] << endl;
 return 0;

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

int main()
{
	int n;
	int ans;
	
	cin >> n;
	
	while(n > 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){
							ans++;
						}
					}
				}
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

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

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

C++: #include<bits/stdc++.h>

using namespace std;

int main()
{
    int n = 0,a = 0,b = 0,c = 0,d = 0,cnt = 0;
    while(1){
        cin >> n;
        for(int i = 9;i >= 0;i--){
            a = i;
            for(int j = i; j>= 0;j--){
                b = j;
                for(int k = j;k >= 0;k--){
                    c = k;
                    for(int l = k;l >= 0;l--){
                        d = l;
                        if(a + b + c + d == n)cnt += 4;
                    }
                }
            }
        }
        cout << cnt << endl;
    }
}

C++: #include <stdio.h>

int main(void) {
	// your code goes here
	int z, a,b,c,d,ans=0;
	while(scanf("%d",&z)!=EOF) {
		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) == z) {
							ans += 1;
						}
					}
				}
			}
		}
				
		printf("%d",ans);
		ans = 0;
	}
	return 0;
}

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

using namespace std;

int solve(const int n) {
	set< vector<int> > s;
	vector<int> v(4);
	for (v[0] = 0; v[0] < 10; v[0]++)
		for (v[1] = 0; v[1] < 10; v[1]++)
			for (v[2] = 0; v[2] < 10; v[2]++)
				for (v[3] = 0; v[3] < 10; v[3]++) {
					int sum = 0;
					for (int i = 0; i < 4; i++) sum += v[i];
					if (sum == n) {
						s.insert(v);
						break;
					}
				}
	return s.size();
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	while (!cin.eof()) {
		int n;
		cin >> n;
		cout << solve(n) << endl;
	}
	return 0;
}

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

int memo[100][100];

int solve(int n, int p){

  if(!n && !p) return 1;
  if(n < 0 || !p) return 0;
  if(memo[n][p]) return memo[n][p];

  int res = 0;
  for(int i=0;i<10;i++) res += solve(n-i, p-1);

  return memo[n][p] = res;
}

int main(){

  for(int i=0;i<100;i++) solve(i, 4);

  int n;
  while(cin >> n) cout << memo[n][4] << endl;
}

C++: #include <iostream>
#include <vector>
using namespace std;
vector<int> ans;
int ch;
int solute(int k)
{
	int num=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==k)
						num++;
				}
		return num;
}
int main()
{
	while(cin>>ch)
	{
		ans.push_back(ch);
	}
	for(int i=0;i<ans.size();i++)
	{
		cout<<solute(ans[i])<<endl;
	}
    
	
	
	return 0;
}

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

int main() {
  unsigned int input;
  unsigned int count;

  while(cin >> input) {
    count = 0;
    for(int a0=0; a0<10; a0++) {
      for(int a1=0; a1<10; a1++) {
        for(int a2=0; a2<10; a2++ ) {
          for(int a3=0; a3<10; a3++) {
            if(a0+a1+a2+a3==input) {
              count++;
            }
          }
        }
      }
    }
    cout << count << endl;
  }

  return 0;
}