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

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

int main(){
	int n;
	int count;

	while (cin >> n){
		
		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; k++){
						if (i + j + k + l == n)count++;
					}
				}
			}
		}
		
		cout << count * 4 << endl;
	
	}

	return 0;
}

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

int a,b,x;

int mySet(int d){
  for(int i=0;i<10;i++){
    if(d<3){
      mySet(d+1);
    }else if(d==3){
      if(a==x){
      b++;
      }
    }
    a++;
  }
  return a=a-10;
}

int main(void){
  while(scanf("%d",&x)!=EOF){
  mySet(0);
  cout<<b<<endl;
  b=0;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int dp[40];
int main(){
	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++){
					dp[i+j+k+l]++;
				}
			}
		}
	}
	while(true){
		int n;cin>>n;
		if(n==0){break;}
		cout<<dp[n]<<endl;
	}
	return 0;
}

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

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

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


return 0;
}

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

namespace {

template <class T>
int combination(std::vector<T> data)
{
  int n = 1;
  while (std::next_permutation(data.begin(), data.end())) {
    ++n;
  }
  return n;
}

int calc(int n)
{
  int com = 0;
  int a, b, c, d;

  for (a = 0; a <= 9; ++a) {
    for (b = a; b <= 9; ++b) {
      for (c = b; c <= 9; ++c) {
        for (d = c; d <= 9; ++d) {
          const int sum = a + b + c + d;

          if (sum == n) {
            std::vector<int> v{a, b, c, d};
            com += combination(v);
          }
          else if (sum > n) {
            return com;
          }
        }
      }
    }
  }

  return com;
}

} // unnamed namespace

int main()
{
  int n;
  while (std::cin >> n) {
    std::cout << calc(n) << std::endl;
  }

  return 0;
}

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

int main(void)
{
	int n;
	char buf[256];
	
	
	while (fgets(buf, 256, stdin) != NULL){
		
		n = atoi(buf);
		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++;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

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

using namespace std;

int main() {
    int n, count;
    while(1) {
      count=0;
      scanf("%d", &n);
      for(int i=0;i<10;i++) {
	for(int j=0;j<10;j++) {
	  for(int k=0;k<10;k++) {
	    if(i+j+k>=n-9 && i+j+k<=n)count++;
	  }
	}
      }
      printf("%d\n", count);
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int n;
  while(~scanf("%d",&n)){
    int cnt = 0;
    REP(a,10)REP(b,10)REP(c,10){
      int d = n-a-b-c;
      if(0<=d && d<10)++cnt;
    }
    cout<<cnt<<endl;
  }
  return 0;
}

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

int main(){
  int a;
  int i, j, k;
  int count;

  while(cin>>a){
    count=0;
    for(i=0; i<10; i++){
      for(j=0; j<10; j++){
        for(k=0; k<10; k++){
          if(i+j+k<=a && i+j+k>=a-9) count++;
        }
      }
    }
    printf("%d\n", count);
  }

  return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
int main(){
	int a,b,c,d,n,x;
	while(cin >> n){
		x=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) x++;
		cout << x << endl;
	}
}

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

using namespace std;

int calc(int i, int count,int sum){
	if (count == 0){
		if (sum == i){
			return 1;
		}
		else{
			return 0;
		}
	}
	else{
		int count2 = 0;
		for (int j = 0; j < 10; j++){
			count2+=calc(i, count - 1, sum + j);
		}
		return count2;
	}

}

int main(){
	int i;
	cin >> i;
	cout<<calc(i, 4,0)<<endl;
	return 0;
}

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

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    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++;
          }   
        }
      }
    }
    std::cout << ans << std::endl;
  }
}

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

int main(void){
  int n;
  int cnt;

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

    cnt = 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( n == i + j + k + l ) cnt++;

	}
      }
    }
  }

  cout << cnt << endl;

  }
  return 0;

}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 using namespace std;
 
 int kk[10*10];
 
 bool binary_search(int x)
 {
   int l=0,r=10*10;
   while(r-l>=1)
   {
     int i=(l+r)/2;
     if(kk[i]==x) return true;
     else if(kk[i]<x) l=i+1;
     else r=i;             
   }     
   return false;
 }

 int main()
 {
   int k;
   int a,b,c,d;
   while(cin>>k)
   {
     int count=0;
     for(a=0;a<10;a++)
     {
       for(b=0;b<10;b++)
       {
         kk[a*10+b]=a+b;                 
       }                 
     }          
     sort(kk,kk+100);
     for(c=0;c<10;c++)
     {
       for(d=0;d<10;d++)
       {
         if(binary_search(k-a-b)) count++;                 
       }                 
     }
     cout<<count<<endl; 
   }
   //while(1);      
   return 0;    
 }