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<iostream>
using namespace std;

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

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

C++: // Sum of 4 integers

#include <iostream>
using namespace std;

int main() {
    int n;

    while (cin >> n) {
        int counter = 0;

        if (n > 36) {
            cout << "0\n";
        } else if (n == 36) {
            cout << "1\n";
        } 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) counter++;
                    }
                }
            }
            cout << counter << "\n";
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>

using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;



int main()
{
	int N;
	while (cin >> N){
		Int ans(0);
		REP(i, 10){
			REP(j, 10){
				REP(m, 10){
					REP(n, 10){
						ans += N == (i + j + m + n);
					}
				}
			}
		}
		cout << ans;
	}
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#define rep(i,n) for(int i=0;i<n;i++)
#define foreach(r,n,p) for(r::iterator it=p.begin();it!=p.end();++it)
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        int ans = 0;
        rep(i,10)rep(j,10)rep(k,10)rep(l,10)
        {
            if(i+j+k+l == n)
            {
                ans ++;
            }
        }
        cout << ans<<endl;

    }
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
int main(){

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

	std::cin>>n;
	i=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){
						i++;
						
						
						}
					}
				}
			}
		}

		std::cout<<i<<std::endl;
    
	return 0;
	}

C++: //
//  main.cpp
//  CppTest
//
//  Created by Ryu on 2017/02/08.
//  Copyright ?? 2017??´ Ryu. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n[50];
    int comb[50];
    int m = 0;
    while (cin >> n[m]) {
        comb[m] = 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[m]) {
                            comb[m]++;
                        }
                    }
                }
            }
        }
        m++;
    }
    
    for (int i = 0; i < m; i++) {
        printf("%d\n", comb[i]);
    }
    
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

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

	while(cin >> n){

	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 = count +1;
					}
				}
			}
		}
	}

	cout << count << endl;
}
}

C++: #include<stdio.h>

int main(void){
  int a,b,c,d,n,i;
  scanf("%d",&n);
  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){
	    i++;
	  }
	}
      }
    }
  }
  printf("%d\n",i);
  return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
  int n,cnt;
  while(scanf("%d",&n) != EOF){
    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;
  }
}

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

#define f(i) for(int i=0; i<10; ++i)


//0008
int main(){
	int x;

	while(cin >> x){
		int a,b,c,d;
		int cout=0;

		f(a)f(b)f(c)f(d){
			if(a+b+c+d == x){
				++count;
			}
		}
		cout << cout <<endl;
	}
	return 0;
}

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

int dp[2][51];

int main()
{
	int n;
	scanf("%d",&n);
	int now = 0;
	for(int i = 0; i <= 50; i++)
	{
		dp[now][i] = 0;
	}
	dp[now][0] = 1;
	for(int k = 0; k < 4; k++)
	{
		int nex = (now + 1) % 2;
		for(int i = 0; i <= 50; i++)
		{
			dp[nex][i] = 0;
		}
		for(int j = 0; j <= 50; j++)
		{
			for(int i = 0; i <= 9; i++)
			{
				if(j + i <= 50)
				{
					dp[nex][j + i] += dp[now][j];
				}
			}
		}
		now = nex;
	}
	printf("%d\n",dp[now][n]);
	return 0;
}

C++: #include<cstdio>

int main(){
	int n;
	int a[] = {1,4,10,20,35,56,84,120,165,220,282,348,415,480,540,592,633,660,670,660,633,592,540,480,415,348,282,220,165,120,84,56,35,20,10,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
	while(scanf("%d", &n) + 1){
		printf("%d\n", a[n]);
	}
	return 0;
}

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

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

	while(cin){
		count=0;
		cin >> n;
		if(n>36){
			cout << "0" << endl;
			continue;
		}
		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;
	}

	return 0;
}

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

C++: import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt(), 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;
                        }
                    }
                }
            }
            System.out.println(ans);
        }
    }
}

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