Go: package main

import (
        "fmt"
)

func main() {
        var n int
        for {
                _, err := fmt.Scanf("%d", &n)
                if err != nil {
                        break
                }
                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++
                                                }
                                        }
                                }
                        }
                }
                fmt.Printf("%d\n", cnt)
        }
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  for (int n; cin >> n, cin;) {
    int ans = 0;
    rep(a,10) rep(b,10) rep(c,10) rep(d,10) if (a+b+c+d == n) ++ans;
    cout << ans << endl;
  }

  return 0;
}

C++: #include <stdio.h>
int pair(int n);
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		printf("%d\n",pair(n));
	}
	return 0;	
}

int pair(int n){
	int a,b,c,d,num=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)) num++;
				}
			}
		}
	}
	return num;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a;
int b;
int c;
int main(){

	
	while (cin >> a){
		c++;
			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 ){
								b++;
							}
						}
					}
				}
			}
}

	cout << b << endl;
	
	return 0;
}

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

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

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

int n;

int slv(int now, int t);

int main(){
  
  while(scanf(" %d",&n) != EOF){
    printf("%d\n",slv(0,0));
  }
  
  return 0;
}

int slv(int now, int t){
  if(now == 4){
    if(t == n)return 1;
    return 0;
  }
  
  int ans = 0;
  for(int i=0;i<10;i++){
    ans += slv(now + 1, t + i);
  }
  
  return ans;
}

C++: #include <cstdio>

int main(){
    int a,b,n,k[100],res=0;

    
    for(a = 0; a <= 9; a++){
        for(b = 0; b <= 9; b++){
            k[a * 10 + b] = a + b;
        }
    }

    while(scanf("%d",&n) == 1){
        res = 0;
        for(a = 0; a <= 9; a++){
            for(b = 0; b <= 9; b++){
                for(int i = 0; i < 100; i++){
                    if( n == a + b + k[i] ) res++;
                }
            }
        }

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

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>

int main()
{
    int n;
    int cnt;  // 正解個数
    
    while (std::cin >> n){
        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++;
                        }
                    }
                }
            }
        }
        std::cout << cnt << std::endl;
    }
    
    return 0;
}

C++:  /*
Write a program which reads an integer n (n &#8804; 50) and identifies the number of combinations of a, b, c, and d (0 &#8804; a, b, c, d &#8804; 9) which meet the following equality:

        a + b + c + d = n
For example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), (9, 9, 9, 8).
 */

#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 serch(int cnt,int n){
	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++;
	return cnt;
}

int main() {
	int n;
	while(cin>>n){
		int cnt=0;
		if(n<36) cnt=serch(cnt,n);
		cout<<cnt<<endl;
	}
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

int main() {
	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 << endl;
	}
}