Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 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 == a {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

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

int setCount(int n) {
    int aRange = 9;
    int bRange = 9;
    int cRange = 9;
    int dRange = 9;
    int sum;
    int count = 0;
    
    for(int a = 0; a <= aRange; a++) {
        for(int b = 0; b <= bRange; b++) {
            for(int c = 0; c <= cRange; c++) {
                for(int d = 0; d <= dRange; d++) {
                    sum = a + b + c + d;
                    if(sum == n){
                        count++;
                    }
                }
            }
        }
    }
    return count;
}

int main(void) {
    int count = 0;
    int n;
    
    while(cin >> n) {
        count = setCount(n);
        cout << count << endl;
        count = 0;
    }
    
    return 0;
}

C++: #include <iostream>

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

using namespace std;

int table[36 + 1];

int main()
{
	rep(a,10)rep(b,10)rep(c,10)rep(d,10) table[a+b+c+d]++;

	int N;
	while (cin>>N)
	{
		if (N > 36)
			cout << 0 << endl;
		else
			cout << table[N] << endl;
	}
	return 0;
}

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

int main(){
  int s = 0;
  int n = 0;
  cin>>n;

  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){
     s++;
  }
 }
 }
 }
  }
  cout<<s<<endl;

  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int ans;
int d[4];
int n;

// 1+2+4+8=15
void rec(int use) {
  if(use == 15) {
    if(d[0]+d[1]+d[2]+d[3]==n) ans++;
  }
  for(int i=0;i<4;i++) {
    if(use & (1<<i)) return;
    for(int j=0;j<10;j++) {
      d[i]=j;
      rec(use|(1<<i));
    }
  }
}

main() {
  while(cin>>n) {
    ans=0; rec(0);
    cout <<ans<<endl;
  }
}

C++: #include <iostream>

using namespace std;

int main()
{
    int table[36 + 1] = {};
    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) {
		    ++table[a + b + c + d];
		}
	    }
	}
    }
    int in;
    while (cin >> in) {
	if (0 <= in && in <= 36)
	    cout << table[in] << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n, ans = 0;
	cin >> n;
	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;
	return 0;
}

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

C++: #include<iostream>

int main(void){
  int a,b,c,d,n;
  int i =0;
  std::cin >> n;
  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 <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <cctype>

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>


using namespace std;

#define Max INT_MAX
#define Inf (INT_MAX/2)
#define Min INT_MIN


#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i,l,n) for(int (i)=(int)(l);(i)<(int)(n);(i)++)
// s <= x < g ?
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
// 0 <= x < w && 0 <= y < h ?
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))

typedef pair<int, int> P;

int main()
{
    int n;

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c,d,n,x,sum=0;
	cin>>x;
	for(a=0;a<=9;a++){
		for(b=0;b<=9;b++){
			for(c=0;c<=9;c++){
				for(d=0;d<=9;d++){
					n=a+b+c+d;
					if(x==n){
						sum++;
					}
				}
			}
		}
	}
	cout<<sum<<endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int memo[51];

int main() {
    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++) {
                    memo[a + b + c + d]++;
                }
            }
        }
    }
    int n;
    while (cin >> n) {
        cout << memo[n] << endl;
    }
    return 0;
}

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

int main() {
	int n;

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

C++: #include <iostream>
using namespace std;
int h[51];
int main() {
 int a,b,c,d,n,j=0,m;
 for (m=0; m<10000; m++) {
	 a=m/1000; b=(m-a*1000)/100;
	 c=(m-a*1000-b*100)/10; d=m-a*1000-b*100-c*10;
     h[a+b+c+d]++;
 }
 while(cin >> n) cout << h[n] << endl;
 return 0;

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

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

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

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

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

using namespace std;

int main()
{
    int n = 0,a = 0,b = 0,c = 0,d = 0,cnt = 0;
    while(1){
        cin >> n;
        for(int i = 9;i >= 0;i--){
            a = i;
            for(int j = i; j>= 0;j--){
                b = j;
                for(int k = j;k >= 0;k--){
                    c = k;
                    for(int l = k;l >= 0;l--){
                        d = l;
                        if(a + b + c + d == n)cnt += 4;
                    }
                }
            }
        }
        cout << cnt << endl;
    }
}

C++: #include <stdio.h>

int main(void) {
	// your code goes here
	int z, a,b,c,d,ans=0;
	while(scanf("%d",&z)!=EOF) {
		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) == z) {
							ans += 1;
						}
					}
				}
			}
		}
				
		printf("%d",ans);
		ans = 0;
	}
	return 0;
}