Go: package main

import "fmt"

var count int

func main() {
	var inputNum int
	for {
		fmt.Scanf("%d", &inputNum)
		fmt.Printf("%d\n", calcA(inputNum))
		count = 0
	}
}

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>
#include<vector>

using namespace std;

int main(){
  int pair[100];
  int input;
  vector<int> inputs;
  
  for(int i = 0; i < 10; i++)
    for(int j = 0; j < 10; j++)
      pair[i * 10 + j] = i + j;


  while(cin >> input) inputs.push_back(input);

  for(int k = 0; k < (int)inputs.size(); k++){
    int input = inputs[k];
    int count = 0;
    
    if(input <= 36){
      for(int i = 0; i < 100; i++){
	int cd = input - pair[i];
	
	if(cd <= 18 && cd >= 0){
	  for(int j = 0; j < 100; j++) if(pair[j] == cd)
	      count++;
	}
      }
    }
    
    cout << count << endl;
  }

  return 0;
}

C++: #include <algorithm>
#include <sstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <string>
#include <queue>
#include <vector>
using namespace std;


int main()
{
	int n, cnt;
	while (cin >> n && n != EOF) {
		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 (n == a + b + c + d) cnt++;
					}
				}
			}
		}

		cout << cnt << endl;
	}
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  int ans;
  while(cin>>N){
    ans = 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;
  }
}

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

int main()
{
    int n,a;
    while(cin>>n)
    {
        int x=0;
        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 <iostream>
using namespace std;
int main(void){
    int a,ans,i,j,k,l;
    while(cin >> a){
        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 == a){
                            ans++;
                        }
                    }
                }
            }
        }
        cout << ans << endl;
    }
}

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

int main() {
  int n;
  vector<int> vec(51, 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++){
          vec.at(i + j + k + l)++;
        }
      }
    }
  }
  
  while(cin >> n){
    cout << vec.at(n) << endl;
  }
  
}

C++: #include <iostream>
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 <= 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){
						ans++;
					}
				}
			}
		}
	}

C++: #include<bits/stdc++.h>
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;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int a;

	while (cin >> a) {
		int counter = 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 == a) {
							counter++;
						}
					}
				}
			}
		}
		cout << counter << endl;
	}

	return 0;
}

C++: #include <iostream>

int main(){
	int n,cnt;
	while(std::cin>>n,n!=EOF){
		cnt=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) cnt++;
					}
				}
			}
		}
		std::cout<<cnt<<'\n';
	}
	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 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 += 1;
            }
          }
        }
      }
    }
    cout << count << endl;
  }
}

C++: #include <iostream>

using namespace std;

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

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) {
    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>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
#define rep(x,to) for(x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

int num,i,j,k,l;
int cnt;

	while(cin >> num){
		cnt=0;
		rep(i,10) rep(j,10) rep(k,10) rep(l,10)
			if(i + j + k + l == num ) cnt++;
		cout << cnt << endl;
	}
	return 0;
}