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

int num ;
int count = 0 ;

int main()
{
	while( cin >> num )
	{
		if( num <= 36 )
		{
			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) == num )
							{
								count ++ ;
							}
						}
					}
				}
			}
		}
		cout << count << endl ;

		count = 0 ;
	}

	return 0 ;
}

C++: #include<iostream>

#define     MIN_NUMBER       (0)
#define     MAX_NUMBER       (9)
#define     MIN_N_NUMBER     (1)
#define     MAX_N_NUMBER     (50)

using namespace std;

int main(){
	int n,cnt = 0;
	int a,b,c,d;

	while(cin >> n){
		// 入力値のチェック
		if((n < ((int)(MIN_N_NUMBER))) || (n > ((int)(MAX_N_NUMBER)))){
			cerr << "Error!!" << endl;
			return -1;
		}

		// 4重ループ
		for(a=((int)MIN_NUMBER);a<=((int)MAX_NUMBER);a++){
			for(b=((int)MIN_NUMBER);b<=((int)MAX_NUMBER);b++){
				for(c=((int)MIN_NUMBER);c<=((int)MAX_NUMBER);c++){
					for(d=((int)MIN_NUMBER);d<=((int)MAX_NUMBER);d++){
						if((a + b + c + d) == n){
							cnt++;
						}
					}
				}
			}
		}

		// 出力
		cout << cnt << endl;

		// cntのクリア
		cnt = 0;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a; i<n; i++)
using namespace std;

int main() {
    int n;
    int a[2010];
    memset(a, 0, sizeof(a));
    rep(i,0,1001) rep(j,0,1001) a[i+j]++;
    while(cin >> n) {
        int ans = 0;
        rep(i,0,2001) {
            if(0 <= n-i && n-i <= 2000) ans = ans + a[i] * a[n - i];
        }
        cout << ans << endl;
    }
    return 0;
}

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

main(){
	int n;
	while(cin>>n){
		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 l=0; l<=9; ++l){
						if(i+j+k+l == n){
							ans++;
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
  int i;
  int count = 0;
  vector<int> ans;
  int a, b, c, d;
  
  while(cin >> i){
    count = 0;
    if(cin.eof()){
      break;
    }
    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 == i){
	      count++;
	    }
	  }
	}
      }
    }
    ans.push_back(count);
  }
  for(int& d : ans){
    cout << d << endl;
  }
}

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

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

    cout << cnt << endl;
  }
}

C++: #include <stdio.h>

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

  i = 0;
  while(i < 50){
    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>
using namespace std;
int ary[60],res[40];
int main(){
	int N;
	for(int i=1;i<=51;i++){
		cin>>ary[i];
		if(cin.eof()){
			N=i-1;
			break;
		}
	}
	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++){
					res[i+j+k+l]++;
				}
			}
		}
	}
	for(int i=1;i<=N;i++){
		cout<<res[ary[i]]<<endl;
	}
	return 0;
}

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

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

}

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

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

int main(void){
	int n;
	int count[51];

	rep(i,51) count[i] = 0;
	rep(a,10)rep(b,10)rep(c,10)rep(d,10){
		count[a+b+c+d]++;
	}

	while(cin>>n){
		cout<<count[n]<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    const int max = 50;
    int counters[max];
    int a, b, c, d, i, maxUsable, target = 0, index;

    for (i = 0; i < max; i++) {
        counters[i] = -1;
    }

    while (cin >> target) {
        index = target-1;

        // 前回の計算結果があればそれを出力
        if (counters[index] != -1) {
            cout << counters[index] << endl;
            continue;
        }

        // 総当りで計算
        if (counters[index] == -1) counters[index] = 0;

        maxUsable = target >= 9 ? 9 : target;
        for (a = 0; a <= maxUsable; a++) {
            for (b = 0; b <= maxUsable; b++) {
                for (c = 0; c <= maxUsable; c++) {
                    for (d = 0; d <= maxUsable; d++) {
                        if (a + b + c + d == target) {
                            counters[index]++;
                        }
                    }
                }
            }
        }

        // 結果の出力
        cout << counters[index] << endl;
    }

    return 0;
}

C++: #include<stdio.h>

int main(){
	int n;
	while(~scanf("%d",&n)){
		int i=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)i++;
		printf("%d\n",i);
	}
}

C++: #include <iostream>
int n = 0;
int main(void){
    int a, b, c, d;
    int cnt;
    while(std::cin >> n){
        cnt = 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) cnt++;
        std::cout << cnt << std::endl;
    }
}

C++: #include <iostream>

using namespace std;

int main ( void )
{
 int n;
 while (cin >> n)
 {
  int count = 0;
  for (int a = 0; a <= 9; ++a)
   for (int b = 0; b <= 9; ++b)
    for (int c = 0; c <= 9; ++c)
    {
      int d = n - ( a + b + c );
      if ( 0 <= d && d <= 9 ) ++count;
    }
  cout << count << endl;
 }
 return 0;
}

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

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

C++: #include <stdio.h>

int main(void){
    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++){
                        cnt += (i+j+k+l)==n ? 1 : 0;
                    }
                }
            }
        }
        printf("%d\n", cnt);
    }
    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;
}