Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		if inputCount == 50 {
			break
		}
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
		count = 0
	}
	for _, v := range resultArr {
		fmt.Printf("%d\n", v)
	}
}

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 <string>
#include<stdio.h>
using namespace std;

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

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( &n[m] );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;i < m;a++ ){
    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[a] ) nCount++;
                }
            }
       }
    }
    printf( "%d\n",nCount );
    }
    return 0;
}

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

int main(){
	while(1){
		int ans=0;
		int n;
		cin>>n;
		if(cin.eof())break;
		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<bits/stdc++.h>
using namespace std;

int main() {

  int n;
  while( scanf("%d", &n) != EOF ) {

    int 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++: int main(){
	
	int e;
	int f=0;
	while(std::cin>>e){
		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==e){
							f++;
						}
		            }
		        }
		    }
		}
		std::cout<<f<<std::endl;
	}
    
    return 0;
    
}

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

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

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	while (scanf("%d", &n) != EOF){
		
		sum = 0;
		
		for (i = 0; i < 10; i++){
			for (j = 0; j < 10; j++){
				for (k = 0; k < 10; k++){
					for (h = 0; h < 10; h++){
						if (i + j + k + h == n){
							sum++;
						}
					}
				}
			}
		}
	
	
		printf("%d\n", sum);
	}
	return (0);
}

C++: #include <iostream>

using namespace std;

int main()
{
	int total = 0; // test
	
	int n;
	while ( cin >> n ) {
		int count;
		if (n>36) count = 0;
		else if (n<=9) count = ((n+1)*(n+2)*(n+3))/6;
		else if (n<=18) count = ((n+1)*(n+2)*(n+3))/6 - 4*((n-9)*(n-8)*(n-7))/6;
		// 220 - ((n-10+1)*(n-10+2)*(n-10+3))/6 + \sum_{k=10}^n { (k+1)(k+2)/2 - 3*(k-9)(k-8)/2 }
		// 220 - ((n-10+1)*(n-10+2)*(n-10+3))/6 + \sum_{k=10}^n { -k^2 + 27k - 107 }
		// 220 - ((n-10+1)*(n-10+2)*(n-10+3))/6 + \sum_{k=1}^n { -k^2 + 27k - 107 } - \sum_{k=1}^9 { -k^2 + 27k - 107 }
		// 220 - ((n-9)*(n-8)*(n-7))/6        - n(n+1)(2n+1)/6      + 27 * n(n+1)/2   - 107n    - 9*10*11/6 + 27*9*10/2 - 107*9
		// 220 - (n^3 - 24n^2 + 191n - 504)/6 - (2n^3 + 3n^2 + n)/6 + (27n^2 + 27n)/2 - 107n    - 165 + 1215 - 963
		// 307 - (3n^3 - 21n^2 + 192n - 504)/6                      + (81n^2 + 81n)/6 - 642n/6
		// 307 - (3n^3 - 102n^2 + 753n - 504)/6
		// 307 - (n^3  -  34n^2 + 251n - 168)/2
		// (-n^3 + 34n^2 - 251n + 782)/2 
		
		// 220  + \sum_{k=10}^n { (k+1)(k+2)/2 } - 4 * ((n-10+1)*(n-10+2)*(n-10+3))/6
		// \sum_{k=1}^n { (k+1)(k+2)/2 }         - 4 * ((n-10+1)*(n-10+2)*(n-10+3))/6
		else if (n<=27) count = ((37-n)*(38-n)*(39-n))/6 - 4*((27-n)*(28-n)*(29-n))/6;
		else count = ((37-n)*(38-n)*(39-n))/6;
		
		cout << count << endl;
		
		total += count; // test
	}
	
	cout << "total = " << total << endl; // test
	
	return 0;
}