Go: package main

import "fmt"

var count int

func main() {
	var inputNum int
	for {
		fmt.Scanf("%d", &inputNum)
		fmt.Printf("%d\n", calcA(inputNum))
		count = 0
	}
}

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

int countNum(int num) {
	int n = 0;
	for (int a = 0; a < 10 && a <= num ; a++) {
		if (num - a > 27)
			continue;
		for (int b = 0; b < 10 && b + a <= num ; b++) {
			if (num - b - a > 18)
				continue;
			for (int c = 0; c < 10 && c + b + a <= num ; c++) {
				if (num - b - a - c > 9)
					continue;
				n++;
			}
		}
	}
	return n;
}

int main() {
	int n = 0;
	cin >> n;
	cout << countNum(n) << endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans=0;
	cin>>n;
	for(a=0;a<=min(n,9);a++){
		k = n-a;
		for(b=0;b<=min(9,k);b++){
			l = k-b;
			for(c=0;c<=min(9,l);c++){
				m = l-c;
				if(0 <= m && m<10){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

C++: #include <stdio.h>

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

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

C++: #include<iostream>

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

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

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

C++: #include<bits/stdc++.h>
using namespace std;
signed main(){
  int a,b;
  while(scanf("%d",&a)!=EOF){
    b=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==a) b++;
	  }
	}
      }
    }
    cout<<b<<"\n";
  }
}

C++: #include <stdio.h>

int main(void) {
	int a;
	while (scanf("%d", &a) != EOF) {
		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 (a == i + j + k + l) count++;
					}
				}
			}
		}
		printf("%d\n", count);
	}
	return 0;
}

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

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

C++: #include <stdio.h>

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

  int i,j,k,l;
  int count;

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

    count=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==n) count++;

	  }

	}

      }

    }

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

  return 0;

}

C++: #include<stdio.h>

main(){int n,k,i,f;while(~scanf("%d",&n)){

        for(f=i=0;k=n-i/100-(i/10)%10-i%10,i<1000;++i)

            if(k<10&&k>=0) f++;

        printf("%d\n",f);

    }

}

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;
}