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 <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);

int main(void){
	int dp[4][36];
	fill_n(*dp, 4*36, 0);
	rep(i, 10)dp[0][i] = 1;
	for(int i = 1; i <= 3; i++){
		for(int j = 36; j >= 0; j--){
			for(int k = 0; k <= 9; k++){
				if(j-k < 0)break;
				dp[i][j] += dp[i-1][j-k];
			}
		}
	}
	int n;
	while(cin >> n)
		FIN(dp[3][n]);

	return 0;
}

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

int main(void){
while(1){
int n;
cin >> n;

int a,b,c,d,cnt=0;
for(a=0; a<=9&&a<=n; a++){
for(b=0; b<=9&&a+b<=n; b++){
for(c=0; c<=9&&a+b+c<=n; c++){
d = n-a-b-c;
if(0<=d&&d<=9)cnt++;
}}}

cout << cnt << endl;
}
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <numeric>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define PI 3.14159265358979

using namespace std;

//================================================

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N, ans = 0;
	while (cin >> N) {
		REP(a, 10) REP(b, 10) REP(c, 10) REP(d, 10) if (a + b + c + d == N) ans++;
		cout << ans << "\n";
		ans = 0;
	}
	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;
    while(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;
    count=0;
    }
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

int main(void) {
	int n;
	while(scanf("%d", &n) != EOF) {
		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 == 35)		count++;
					}
				}
			}
		}
		cout << count << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

int main() {
    int n, count;
    while(1) {
      count=0;
      scanf("%d", &n);
      if(n == EOF) break;
      for(int i=0;i<10;i++) {
	for(int j=0;j<10;j++) {
	  for(int k=0;k<10;k++) {
	    if(i+j+k>=n-9 && i+j+k<=n)count++;
	  }
	}
      }
      printf("%d\n", count);
    }
}

C++: #include <iostream>

using namespace std;
int main() {
  int sum;
  while (cin >> sum) {
    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 == sum) ans++;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

#define upper 9

using namespace std;

int main(void){
	int n = 0;
	vector<int> vec;
	while(cin >> n){
		int count = 0;
		for(int a=0; a<=upper; ++a){
			for(int b=0; b<=upper; ++b){
				for(int c=0; c<=upper; ++c){
					for(int d=0; d<=upper; ++d){
						if ((a+b+c+d) == n){
							++count;
						}
					}
				}
			}
		}
		vec.push_back(count);
	}
	vector<int>::iterator it = vec.begin();
	while(it != vec.end()){
		cout << *it << endl;
		++it;
	}
	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){
if(x-(i+j+k)>=0){
ans++;
}
}
}
}
}
cout<<ans;
}
}

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

bool binary_search(vector<int> a, int x){
	int left = 0, right = a.size() - 1;

	while (left <= right){
		int mid = (left + right) / 2;
		if (a[mid] == x) return true;
		else if (a[mid] < x) left = mid + 1;
		else right = mid - 1;
	}
	return false;
}

int main()
{
	vector<int> vec(19);
	int cnt = 0;
	for (auto& x : vec) x = cnt++;
	int n;
	cnt = 0;
	while (cin >> n){
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				if (binary_search(vec, n - i - j)){
					if (n - i - j == 0 || n - i - j == 18) cnt++;
					else cnt += 2;
				}
			}
		}
		cout << cnt << "\n";
		cnt = 0;
	}
	cout.flush();
}

C++: #include <iostream>

using namespace std;

bool calc(int a, int b, int n) {
	n -= a-b;
	for (int c=0; c<10; c++) {
		for (int d=0; d<10; d++) {
			if (n == c+d) return true;
		}
	}
	return false;
}

void solve(int n) {
	int count = 0;
	for (int a=0; a<10; a++) {
		for (int b=0; b<10; b++) {
			if (calc(a,b,n)) cout++;
		}
	}
	cout << count << endl;
}

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
bool h[1000010]={false};
int main(){
	int n;
	while(cin>>n){
		int co=0;
		rep(i,10)rep(j,10)rep(k,10)rep(q,10)if(i+j+k+q==n)co++;
		cout<<co<<endl;
	}
}

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

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

constexpr int n_ints = 4;
constexpr int min_int = 0;
constexpr int max_int = 9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    int res = 0;
    FOR(a,min_int,max_int+1)
    FOR(b,min_int,max_int+1)
    FOR(c,min_int,max_int+1)
    FOR(d,min_int,max_int+1) {
        int sum = a + b + c + d;
        if (sum == n) { ++res; }
    }
    cout << res << endl;

    return 0;
}

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