Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 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 {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,count;
    count = 0;
    while (cin >> n) {
        for (int i=9;i>-1;i--) {
            if (n-i>=0) {
                for (int j=9;j>-1;j--) {
                    if (n-i-j>=0) {
                        for (int k=9;k>-1;k--) {
                            if (n-i-j-k>=0) {
                                for (int l=9;l>-1;l--) {
                                    if (n-i-j-k-l==0) {
                                        count++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout << count << endl;
        count = 0;
    }
}

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

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

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

int main ()
{
    int	n;

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

        cout << res << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){int n;while(cin >> n){int cnt = 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){cnt++;}}}}}cout << cnt <<endl;}
return 0;

C++: #include <iostream>

int main(){
    int n, a, b, c, d, p;

    while(std::cin >> n){
        p = 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){
                            p++;
                        }
                    }
                }
            }
        }
        std::cout << p << std::endl;
    }
}

C++: #include <iostream>

using namespace std;

// naive but easy to implement
int calc(int n)
{
  int count = 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){
            count++;
          }
        }
      } 
    }
  }

  return count;
}

int main(int argc, char const* argv[])
{
  int n;
  while (cin >> n) {
    cout << calc(n) << endl;
  };
  return 0;
}

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

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

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

using namespace std;

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

C++: #include <iostream>
#define rep(i,a) for(int i=0;i<a;++i)

using namespace std;

int main(void)
{
	int n;
	while(cin >> n)
	{
		int a[4] = {};
		int count = 0;
		rep(i,10)
		{
			rep(j,10)
			{
				rep(c,10)
				{
					rep(d,10)
					{
						if(i+j+c+d == n)
							++count;
					}
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;

int main() 
{
	int a, b, c, d;
	int n;
	int count = 0;
	while (1) 
	{
		cin >> n;
		if (n >= 0 && n <= 50)
		{
			for (a = 0; a <= 9; a++) {
				for (b = 0; b <= 9; b++) {
					for (c = 0; c <= 9; c++)
					{
						d = n - (a + b + c);
						if (d >= 0 && d <= 9) {
							printf("a = %d, b = %d,c = %d, d = %d \n", a, b, c, d);
							count++;
						}
					}
				}
			}
			printf("%d\n", count);
			break;
		}
		else 
		{
			printf("????????°????????\????????????????????????\n");
		}
	}
}

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

using namespace std;

int main()
{
	int n;
	double  ans;

	cin >> n;

	if(n > 36){ans = 0;}
	else{ans = pow(4, 36 - n);}

	printf("%.0f\n", ans);

	return 0;
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;

    while (cin >> n)
    {
        int count = 0;
        rep(a, 10)
        {
            rep(b, 10)
            {
                rep(c, 10)
                {
                    rep(d, 10)
                    {
                        if (a + b + c + d == n)
                        {
                            count++;
                        }
                    }
                }
            }
        }
        OP(count)
    }
    return 0;
}

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

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

int cnt[52];

int main(void){
  rep(i,10)rep(j,10)rep(k,10)rep(l,10)cnt[i+j+k+l]++;

  int x;
  while(cin>>x){
    cout<<cnt[x]<<endl;
  }

  return 0;
}

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

using namespace std;

int main() {
	
	long long a, b, c=0, d=0, f, n, m;
	
	cin >> a >> b;
	
	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 == a ){
						c ++;
					}
					if (i + j + k + l == b ){
						d ++;
					}
					
				}
			}	
		}
	}
	cout << c << endl << d;
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

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

int main(){
	ios::sync_with_stdio(false);

	int n, count;
	int a, b, c, d;

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