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<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;

int main(){
  int n;
  while(cin>>n){
    int ans = 0;
    REP(a,10) REP(b,10) REP(c,10){
      int d = n - a - b - c;
      if( d >= 0 && d <= 9) ans++;  
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <stdio.h>
int main(){
	int n;
	scanf("%d", &n);
	int result = 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){
						++result;
					}
				}
			}
		}
	}
	printf("%d\n", result);
}

C++: #include<iostream>
using namespace std;
int main()
{
    long n,a,b,c,d,count;
    while(cin>>n){
    count=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++){
    if(a+b+c+d==n)
	count++;
                }
                }
            }
        }
    cout<<count<<endl;
    }
}

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

int saiki(int n, int m, int k){
	if(k==4){
		if(n==m) return 1;
		else return 0;
	}else{
		int sum = 0;
		for(int i=0; i<10; i++){
			sum += saiki(n, m+i, k+1);
		}
		return sum;
	}
}

int main(){
	int sum = 0;
	int n;
	while(scanf("%d", &n)>0){
		/*
		sum = 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) sum++;
					}
				}
			}
		}
		printf("%d\n", sum);
		*/
		cout << saiki(n, 0, 0) << endl;
	}

	return 0;
}

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

using namespace std;

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

	int count = 0;
	vector<int> result;
	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++;

		result.push_back(count);
		count = 0;
	}

	for(const int& x : result){
		cout << x << endl;
	}


	return 0;
}

C++: #include <cstdio>

#define reep(i,n,m) for(int i=(n);i<(m);i++)
#define rep(i,n) reep(i,0,n)

int main(){
    int n;
    while(scanf("%d",&n)!=EOF){
        int ans=0;
        rep(a,10){
            rep(b,10){
                rep(c,10){
                    rep(d,10){
                        if(a+b+c+d==n)
                            ans++;
                    }
                }
            }
        }

        printf("%d\n",ans);
    }
}

C++: #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#define mid (l+r>>1)
#define lc (o<<1)
#define rc (o<<1|1)
using namespace std;
const int maxn = 1000010;

int sumv[maxn*4], ql, qr, v, _sum;
int n;

void insert(int o, int l, int r)
{
    if(ql <= l && r <= qr) {
        sumv[o] = 1<<v;
        return;
    }
    sumv[lc] = sumv[rc] = sumv[o];
    sumv[o] = 0;
    int m = mid;
    if(ql <= m) insert(lc, l, m);
    if(qr >  m) insert(rc, m+1, r);
    sumv[o] = sumv[lc] | sumv[rc];
    printf("%d %d %d\n", l, r, sumv[o]);
}

void query(int o, int l, int r)
{
    if(ql <= l && r <= qr) {
        _sum |= sumv[o];
        return;
    }
    int m = mid;
    if(ql <= m) query(lc, l, m);
    if(qr >  m) query(rc, m+1, r);
}

int gao(int s)
{
    int ans = 0;
    while(s) {
        ans += s&1;
        s >>= 1;
    }
    return ans;
}

int main()
{
    freopen("b.txt", "r", stdin);
    freopen("bout", "w", stdout);
    int m;
    while(scanf("%d%d", &n, &m), n)
    {
        printf("%d %d\n", n, m);
        if(n == 0) break;
        memset(sumv, 0, sizeof sumv);
        char op[3];
        for(int i = 0; i < m; i++)
        {
            scanf("%s", op);
            if(op[0] == 'P') {
                scanf("%d%d%d", &ql, &qr, &v); v--;
                insert(1, 1, n);
                puts("");
            } else {
                scanf("%d%d", &ql, &qr);
                _sum = 0;
                query(1, 1, n);
                printf("__%d\n", gao(_sum));
            }
        }
    }
    return 0;
}
/*
5 10
1 3 4
1 5 4

1 2 12
1 3 12
1 5 12

__1
__2
1 3 12
1 5 12

1 3 76
1 5 76

__3
__2
4 5 204
1 5 204

__4
*/

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

using namespace std;

int main(){

	int n;
	while(true){

	cin >> n;

	if(cin.fail()) break;

	int x=0; int y=0; int s=0;
	REP(i,0,n){
		REP(a,0,9){
		REP(b,0,9){
		if(a+b==i) x++;
		}
		}
		REP(c,0,9){
		REP(d,0,9){
		if(c+d==n-i) y++;
		}
		}

		s+=x*y;
		x=0; y=0;
	}

	cout << s << endl;

	}

	return 0;
}

C++: #include<iostream>

using namespace std;
#define RENT 100000
int main(){
	int n, ans;
	int counter = 0;
	while (cin >> n){
ans=0;
		for (int i = 0; i < 10; i++){
			for (int q = 0; q < 10; q++){
				for (int w = 0; w < 10; w++){
					for (int e = 0; e < 10; e++){
						ans = i + q + w + e;
						if (ans == n){
							counter += 1;
						}
					}
				}
			}
		}
		cout << counter << endl;
	}
}

C++: #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main(){
    int n;
    while(scanf("%d",&n) != EOF){
        int c = 0;
        REP(i,10){
            REP(j,10){
                REP(k,10){
                    REP(l,10){
                        if(i + j + k + l == n)
                            c++;
                    }
                }
            }
        }
        printf("%d\n",c);
    }
}

C++: #include <iostream>

using namespace std;

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

    return 0;
}

C++: #include <iostream>

using namespace std;

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