Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

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

int main( void ){
    int nCount = 0;
    int n[50];
    int m = 0;
    char str[3];
    while( true ){
        gets( str );
        if(( n[m] = atoi(str)) == -1 ) break;
        m++;
    }
    for( int a = 0;a < 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>
#include<cstdio>

using namespace std;


int main(){
	
	int n;
	while(scanf("%d",&n)!=-1){
		
		int ans = 0;
		for(int i=0;i<=9;i++){
			for(int j=0;j<=9;j++){
				for(int k=0;k<=9;k++){
					for(int p=0;p<=9;p++){
						if(i+j+k+p == n)ans++;
					}
				}
			}
		}
		
		cout<<ans<<endl;
	}
}

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

int main(){
int n,a,b,c,d,count;
while(scanf("%d",&n) != EOF){

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

printf("%d\n",count);
}
return 0;		
}

C++: #include<iostream>

using namespace std;

int get_numpair( int num );

int main(void)
{
	int num;

	for(;;)
	{
		cin >> num;
		if( cin.eof() ) break;
		cout << get_numpair(num) << endl;
	}

	return 0;
}

int get_numpair( int num )
{
	int numpair = 0;
	int pair[4];

	for( int i = 0 ; i <= 9999 ; i++ )
	{
		pair[3] = i/1000;
		pair[2] = (i%1000)/100;
		pair[1] = ((i%1000)%100)/10;
		pair[0] = ((i%1000)%100)%10;

		int sum = 0;
		for( int j = 0 ; j < 4 ; j++ )
		{
			sum += pair[j];
		}
		if( sum == num ) numpair ++;
	}

	return numpair;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n;
    while (true) {
        int count = 0;
        cin >> n;
        if (cin.eof()) {
            return 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) {
                            ++count;
                        }
                    }
                }
            }
        }
        cout << count << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  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>

using namespace std;

int main(void){
	int n,a[4],count;

	while(cin >> n){
		count=0;
		for(a[0]=0;a[0]<10;a[0]++)
			for(a[1]=0;a[1]<10;a[1]++)
				for(a[2]=0;a[2]<10;a[2]++)
					for(a[3]=0;a[3]<10;a[3]++)
						if(a[0]+a[1]+a[2]+a[3]==n){
							count++
							break;
						}
		cout << count << endl;
	}

	return 0;
}

C++: // 2011/05/31 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int n;
		cin >> n;
		if(cin.eof())
			break;

		int cnt = 0;
		for(int a=0; a<=9; a++){
			if(a>n)
				break;
			for(int b=0; b<=9; b++){
				if(a+b>n)
					break;
				for(int c=0; c<=9; c++){
					if(a+b+c>n)
						break;
					for(int d=0; d<=9; d++){
						if(a+b+c+d>n)
							break;
						if(a+b+c+d==n)
							cnt++;
					}
				}
			}
		}

		cout << cnt << endl;
	}

	return 0;
}

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

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

	cin >> n;

	iCount = 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 )
						iCount++;
				}
			}
		}
	}

	cout << iCount << endl;

	return 0;
}

C++: #include <iostream>

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

C++: #include <iostream>

using namespace std;

int calc(int a, int b, int n) {
	int tmp = n-a-b;
	int count = 0;
	for (int c=0; c<10; c++) {
		for (int d=0; d<10; d++) {
			if (tmp == c+d)
				count++;
		}
	}
	return count;
}

void solve(int n) {
	int count = 0;
	for (int a=0; a<10; a++) {
		for (int b=0; b<10; b++) {
			count += calc(a,b,n);
		}
	}
	cout << count << endl;
}

int main() {
	int n;
	while (cin >> n) {
		solve(n);
	}
	return 0;
}

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

int main() {
  unsigned int input;
  unsigned int count=0;
  cin >> input;

  for(int a0=0; a0<10; a0++) {
    for(int a1=0; a1<10; a1++) {
      for(int a2=0; a2<10; a2++ ) {
        for(int a3=0; a3<10; a3++) {
          if(a0+a1+a2+a3==input) {
            count++;
          }
        }
      }
    }
  }
  cout << count << endl;

  return 0;
}

C++: #include <iostream>

using namespace std;

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

	while(cin >> n) {
		if(n>50)
			continue;
		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++) {
						sum=0;
						sum+=a+b+c+d;
						if(sum==n)
							count++;
						if(sum>35)
							break;

					}
				}
			}
		}
		cout << count << endl;
	}

	return 0;

}

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

int main() {
	while(true) {
		int n;
		if(scanf("%d",&n)<1)break;
		int count = 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)count++;
		printf("%d\n",count);
	}
	return 0;
}

C++: #include <cstdio.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 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; 
  } 
  return 0;
}