Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
	int n;
	while(cin>>n){
		int count = 0;
		REP(i, 10)
			REP(j, 10)
			REP(k, 10)
			REP(l, 10)
			if (i + j + k + l == n)count++;
		cout << count << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define ll long long int

#define rep(p,q) for(int i = p; i < q;i++)


//8
int main(void) {
	int n;
	while (cin >> n) {
		if (n > 36) cout << 0 << endl;
		else {
			int ans = 0;
			for (int i = 0; i < 10; i++) {
				int sum = i;
				for (int j = 0; j < 10; j++) {
					sum = i;
					sum += j;
					if (sum > n)continue;
					for (int k = 0; k < 10; k++) {
						sum = i + j;
						sum += k;
						if (sum > n)continue;
						for (int l = 0; l < 10; l++) {
							sum = i + j + k;
							sum += l;
							if (sum == n) ans++;
						}
					}
				}
			}
			cout << ans << endl;
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <cmath>

using namespace std;

const int N = 1e6 + 10; 
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;

struct node {
    int x, y;
    bool operator < (const node &a) const {
        if (x != a.x) return x < a.x;
        else return y < a.y; 
    }
};

node s[N], t[N];


int c[111];
bool cmp1(const node &a, const node &b) {
    if (a.x != b.x) return a.x > b.x;
    else return a.y > b.y;
}

int main() {
    int n, m;
    while (scanf("%d%d", &n, &m) != EOF) {
        int ma = 0;
        for (int i = 1; i <= n; ++i) scanf("%d%d", &s[i].x, &s[i].y), ma = max(ma, s[i].y);
        for (int i = 1; i <= m; ++i) scanf("%d%d", &t[i].x, &t[i].y);
        sort(s + 1, s + n + 1, cmp1);
        sort(t + 1, t + m + 1, cmp1);
        int num = 0;long long ans = 0;
        memset(c, 0, sizeof(c));
        int id = 1;
        for (int i = 1; i <= m; ++i) {
            while (id <= n && s[id].x >= t[i].x) {
                ++c[s[id].y];
                ++id;
            }
            for (int j = t[i].y; j <= ma; ++j) {
                if (c[j] != 0) {
                    --c[j];
                    ++num;
                    ans += t[i].x * 500 + t[i].y * 2;
                    break;
                }
            }
        }
        printf("%d %I64d\n", num, ans);
    }
    return 0;
}

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

int main(void) {
  int in;
  int table[51];

  memset(table, 0, sizeof(table));
  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]++;
        }
      }
    }
  }
  while(cin) {
    cin >> in;
    cout << table[in] << endl;
  }
  return 0;
}

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

int main (void){
	int n;
	while(~scanf("%d",&n)){
		int a,b,c,d,res=0;
		for(a=0;a<=9;a++)
			for(b=0;b<=9;b++)
				for(c=0;c<=9;c++)
					for(d=0;d<=9;d++)
						res += (a+b+c+d == n);
		std::cout << res << std::endl;
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
int n,S;
int a[4];
S=0;
while(cin>>n)
{
a[0]=0;
a[1]=0;
a[2]=0;
a[3]=0;
for(int i=0;i<10;i++)
{
	a[0]=i;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	for(int j=0;j<10;j++)
{
	a[1]=j;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
for(int k=0;k<10;k++)
{
	a[2]=k;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	for(int l=0;l<10;l++)
{
	a[3]=l;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
	
}
}	
}
}	
}
cout<<S<<endl;
return 0;
}

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

using namespace std;
#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
  int n;
  while(cin >> n){
    int ans=0;
    rep(i,10)rep(j,10)rep(k,10)rep(l,10){
      ans+=i+j+k+l==n;
    }
    cout << ans << endl;
  }
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cmath>
 
using namespace std;

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

C++: #include<cstdio>

using namespace std;

signed main(){
    int ret = 0;
    int n; scanf("%d", &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 ) ret++;
            }
        }
    }    
    printf( "%d\n", ret );
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int n;
int num=0;
while(cin>>n){
for(int h=0;h<=9;h++){
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=0;k<=9;k++){
if(h+i+j+k==n){num++;}
}
}
}
}
cout<<num<<endl;
num=0;
}
}

C++: #include <cstdio>

using namespace std;

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