Go: package main

import (
  "fmt"
)

func main() {
  var a int
  var b int
  for _, err := fmt.Scan(&a); err == nil; _, err = fmt.Scan(&a) {
    b = 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) {
              b++
            }
          }
        }
      }
    }
  fmt.Println(b)
  }
}

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;
}

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

int main(void){
    int n;
    int a,b,c,d;
    int count;
    while(cin>>n){
        count=0;
        for(a=0;a<=9;a++){
            for(b=0;b<=9;b++){
                for(c=0;c<=9;c++){
                    d=n-a-b-c;
                    if(0<=d and d<=9){count++;}
                }
            }
        }
        cout<<count<<endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int n,sum[50]={0},i=0;
  while(cin >> n){
    if(n >= 37){
      sum[i] = 0;
      i++;
    }
    else{
      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) sum[i]++;
	    }	    
	  }
	}
      }
      i++;
    }
    cout << sum[i-1] << endl;
  }
  int j;
  // for(j = 0; j <= i; j++) cout << sum[j] << endl;
}

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

using namespace std;

int solve(const int n) {
	set< vector<int> > s;
	vector<int> v(4);

	for (v[0] = 0; v[0] < 10; v[0]++)
		for (v[1] = 0; v[1] < 10; v[1]++)
			for (v[2] = 0; v[2] < 10; v[2]++)
				for (v[3] = 0; v[3] < 10; v[3]++) {
					int sum = 0;
					for (int i = 0; i < 4; i++) sum += v[i];
					if (sum == n) {
						s.insert(v);
						break;
					}
				}
	return s.size();
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	while (cin >> n) {
		cout << solve(n) << endl;
	}
	return 0;
}