Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
	}
	for _, value := range resultArr {
		fmt.Println(value)
	}
}

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 <bits/stdc++.h>

using namespace std;

template<typename T> class Polynomial {
private:
  vector<T> val;
	
public:
	Polynomial() {}

	Polynomial(const vector<T>& val) : val(val) {}

	Polynomial(const int n) : val(vector<T>(n, 0)) {}

	Polynomial(const int n, const T val) : val(vector<T>(n, val)) {}

	Polynomial operator+=(const Polynomial& p) {
    for (int i = 0; i < p.size(); ++i) {
      if (int(val.size()) == i) val.emplace_back(p[i]);
      else val[i] += p[i];
    }
		return *this;
	}
  
	Polynomial operator-=(const Polynomial& p) {
    for (int i = 0; i < p.size(); ++i) {
      if (int(val.size()) == i) val.emplace_back(-p[i]);
      else val[i] -= p[i];
    }
		return *this;
	}
  
	Polynomial operator*=(Polynomial p) {
		return *this = *this * p;
	}
  
	Polynomial operator+(const Polynomial& p) const {
		Polynomial res = *this;
		res += p;
		return res;
	}
	
	Polynomial operator-(const Polynomial& p) const {
		Polynomial res = *this;
		res -= p;
		return res;
	}

  // TODO FFT
	Polynomial operator*(Polynomial& p) {
		Polynomial res(size() + p.size());
    for (int i = 0; i < size(); ++i) {
      for (int j = 0; j < p.size(); ++j) {
        res[i + j] += val[i] * p[j];
      }
    }
		return res;
	}
	
  T& operator[](int i) {
    if (i >= int(val.size())) val.resize(i + 1, 0);
    return val[i];
  }

  int size() const {
    return val.size();
  }

  Polynomial identity() const {
    return Polynomial(1, 1);
  }
};

int main() {
  Polynomial<int> poly;
  poly = poly.identity();
  for (int i = 0; i < 4; ++i) poly *= Polynomial<int>(10, 1);

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

C++: #include <iostream>
using namespace std;
int main()
{
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++)for(int m = 0; m < 10; m++) if(i+j+k+l+m==n) ans++;
cout << ans << endl;
}
return 0;
}

C++: #include <stdio.h>

int main()
{
    int n,i,j,k,l,cnt;
    while (scanf("%d",&n)!=EOF){
    cnt=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)
                        cnt=cnt+1;
                }
            }
        }
    }
    printf("%d\n",cnt);
    }
    return 0;
}

C++: #include <stdio.h>

int main(){
	int n,answer;

	while( scanf("%d", &n) !=EOF ){
		answer = 0;
		if(n<=36){
			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){
								answer++;
							}
						}
					}
				}
			}
		}
		printf("%d\n", answer);
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {

	int n;
	int num[4];
	int count;

	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++;
						}
					}
				}
			}
		}
		cout << count <<endl;
	}

	return 0;

}

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

int main(){
	int n,ans;

	while( cin >> n ){
		ans = 0;
		if(n<=36){
			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){
								ans++;
							}
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}

C++: #include<cstdio>
main(){for(int i,c,k,n,j;scanf("%d",&n)+1;k=0){for(i=0;i<1e4;c=0){for(j=i++;j;j/=10)c+=j%10;c-n?k:k++;}printf("%d\n",k);}}

C++: #include <iostream>
using namespace std;
//typedef long long int lli;

int halfComb[2001]; // 0 to 2000  init with 0

void init() {
  for(int i = 0; i < 1001; i++)
    for(int j = 0; j < 1001; j++)
      halfComb[i+j]++;
}

int main(){
  int cnt;
  int n;

  init();
  
  while(cin >> n) {
    cnt = 0;
    for(int i = 0; i <= n; i++) {
      cnt += halfComb[i] * halfComb[n-i];
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using  namespace std;
#define ll    long long int
#define pai     pair<int,int>
#define vi      vector<int>
#define vd      vector<double>
#define mpi     map<int,int>
#define mps     map<string,int>
#define sti     stack<int>
#define stc     stack<char>
#define sei     set<int>
#define ses     set<string>
#define multii  multiset<int>
#define forn(i,n)    for (int i = 0; i < n; i++)
#define fork(i,k,n)  for (int i = k; i <= n; i++)
#define forkr(i,k,n) for (int i = k; i >= n; i--)


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

C++: #include <cstdio>

using namespace std;

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

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#define LL long long
using namespace std;
int dp[55][5];
int dfs(int n, int m){
    int&r = dp[n][m];
    if(r!=-1)return r;
    if(m==0){
        return r=n==0;
    }
    r=0;
    for(int i=0;i<=9;i++){
        if(n>=i){
            r+=dfs(n-i,m-1);
        }
    }
    return r;
}

int main(){
    memset(dp, -1, sizeof(dp));
    int n;
    while(cin>>n){
        cout<<dfs(n,4)<<endl;
    }
    return 0;
}

C++: #include <stdio.h>
#include <srdlib.h>
#include <string.h>

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == 0 ) break;
        m++;
    }
    for( int a = 0;a < m+1;a++ ){
    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[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    nCount = 0;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int N, a,b,c,d,count=0;
	cin >> N;
	
	for(int i=0; i<10;i++){
		if((N-i)/3 >9) continue;
		for(int j=0; j<10;j++){
			if((N-i-j)/2 > 9) continue;
			for(int k=0; k<10;k++){
				if((N-i-j-k) > 9 || (N-i-j-k)<0) continue;
				//cout << i<< " " << j << " " << k << " "<< N-i-j-k <<endl;
				count++;
			}
		}
	}
	cout << count << endl;
	return 0;
}

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

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

    cout << cnt << endl;
  }
}

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

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