Go: package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	for scanner.Scan() {
		count := 0
		for i := 9; i >= 0; i-- {
			numCpy, _ := strconv.Atoi(scanner.Text())
			if numCpy-i >= 0 {
				for j := 9; j >= 0; j-- {
					numCpyi := numCpy - i
					if numCpyi-j >= 0 {
						for k := 9; k >= 0; k-- {
							numCpyj := numCpyi - j
							if numCpyj-k >= 0 {
								for l := 9; l >= 0; l-- {
									numCpyk := numCpyj - k
									if numCpyk-l == 0 {
										count++
										break
									}
								}
							}
						}
					}
				}
			}
		}
		fmt.Println(count)
	}

}

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

#define int				long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define FORE( i, m, n ) FOR( i, m , n + 1 )
#define REP( i, n )     FOR( i, 0, n )
#define REPE( i, n )	FOR( i, 0, n + 1 )
#define REPR( i, m )	for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )	FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()             
#define MP( a, b )		make_pair( (a), (b) )
#define fi				first
#define se				second

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

int gcd( int a, int b ) {
	if( a % b == 0 ) return b;
	else			 gcd( b, a % b );
}

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

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

using namespace std;

int main() {
	int num[4], n;
	int count = 9;
	int point[10] = {0};

	cin >> n;

	for(int i = 0; i < 4; i++) {
		if(n - count >= 0) {
			n -= count;
			num[i] = count;
		}
		else {
			count--;
			i--;
		}
	}


	for(int i = 0; i < 4; i++) {
		point[num[i]]++;
	}

	int c = 0;

	for(int i = 1; i < 10; i++) {
		if(point[i] != 0) {
			c++;
		}

	}
	int ans = 1;

	if(c == 4) {
		for(int i = 4; i >= 1; i--) {
			ans *= i;
		}
	}
	else if(c == 3) {
		for(int i = 4; i >= 1; i--) {
			ans *= i;
		}
		ans /= 2;
	}
	else if(c == 2) {
		for(int i = 4; i >= 1; i--) {
			ans *= i;
		}
		ans /= 6;
	}
	else if(c == 1) {
		for(int i = 4; i >= 1; i--) {
			ans *= i;
		}
		ans /= ans;
	}

	cout << ans << endl;
}

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

int n;
int ans;


void saiki(int x, int c)
{
	if(x == 0 && c == 5)
		ans++;

	for(int i = 9; i >= 0; i--){
		if(x - i >= 0 && c <= 4)
			saiki(x-i,c+1);
	}

}

int main(void)
{

	int d[20];

	int c = 0;


	while(cin >> n, n){
		ans = 0;
		saiki(n,1);
		cout << ans << endl;
	}


	return 0;
}

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

int main(){
	int n;
	while(cin>>n){
		int i,j,k,l,a=0;
		for(i=0;i<=9;i++){
			for(j=0;j<=9;j++){
				for(k=0;k<=9;k++){
					for(l=0;l<=9;l++){
						if(i+j+k+l==n)a++;
					}
				}
			}
		}
		cout<<a<<endl;
	}

    return 0;
}

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

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

C++: #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
int n;
using namespace std;
int main(){
	std::ios::sync_with_stdio(false);
	while(cin>>n){
		
		int counter=0;
		for(int i=0;i<=9;i++){
			for(int k=0;k<=9;k++){
				for(int j=0;j<=9;j++){
					for(int p=0;p<=9;p++){
						if(n==i+k+j+p){
							counter++;
							//break;
					}
				}
			}
		}
	}
		cout<<counter<<"\n";
		
	}
	

	return 0;
}

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

int main(void){
     int n,i=0;

     while(cin >> n,!cin.eof()){
	  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){
				   i = i+1;
			      }
			 }
		    }
	       }
	  }
     }

     cout << i << endl;

     return 0;
}

C++: #include <iostream>

int main(void){

int input=0;
int output=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++){
			int abcd=a+b+c+d;
				if(abcd==input){
					output++;
				}
			}
		}
	}

	cout << output;
}

C++: #include <iostream>

using namespace std;

int main(){
  int a,b,c,d,n,count = 0;
  
  cin >> 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((a+b+c+d)==n)count++;
	}
      }
    }
  }
  
  cout << count << endl;
  return 0;
}

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

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


int main()
{
	int n; 
	while(cin>>n)
	{
		int ans=0;

		REP(i,10) REP(j,10) REP(k,10)
		{
			if( (i+j+k)<=n && (i+j+k)+9>=n ) ++ans;
		}

		cout<<ans<<endl;
	}

	return 0;
}

C++: //52
#include<iostream>

using namespace std;

int main() {
     for(int n;cin>>n;){
       int ans=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++){
	       ans+=a+b+c+d==n;
             }
	   }
	 }
       }
       cout << ans << endl;
     } 
   return 0;
    }

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0008
#include <iostream>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int n; 
	while (cin >> n) {
		int ans = 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;
	}
}

C++: #include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>

using namespace std;





int main()
{
	int n;
	int sum;
	int k[19];//k[i]???i?????????????¶?????????§??????????????¨?????????????????????
	while (cin >> n) {
		sum = 0;
		if (n > 36) {
			cout << "0" << endl;
			break;
		}
		else{
			
			for (int i = 0; i < 19; i++) {
				if (i < 10) {
					k[i] = i + 1;
				}
				else {
					k[i] = 19 - i;
				}
			}
			for (int i = max({0,n-18}); i <= min({ 18,n }); i++) {
				sum += k[i] * k[n - i];
			}
		}
		cout << sum << endl;
	}





}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int func(int sum, int depth)
{
	if (sum < 0)
	{
		return 0;
	}
	if (sum == 0)
	{
		return 1;
	}
	if (depth == 3)
	{
		if (sum < 10)
			return 1;
		else
			return 0;
	}
	int ans = 0;
	for (int i = 0; i < 10 && i <= sum; i++)
	{
		ans += func(sum - i, depth+1);
	}
	return ans;
}

int main(int argc, char const *argv[])
{
	int n;
	while (scanf("%d", &n) != EOF)
	{
		if (n > 36)
		{
			printf("0\n");
			continue;
		}
		int num = func(n, 0);
		printf("%d\n", num);
	}
	return 0;
}