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<stdio.h>

int main(){
	int n;

	while(scanf("%d",&n)!=EOF){
		int a,b,c,d,count;
		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((n-a-b-c-d)==0){
							count++;
						}
					}
				}
			}
		}

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


}

C++: include <iostream>

using namespace std;

int main(){
  int s;
  while(cin >> s){
    int c = 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) == s){
              c++;
            }
          }
	}
      }
    }
    cout << c;
  }

}

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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int n;
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        for (int k = 0; k < 10; k++) {
          int l = n - i - j - k;
          ans += (l >= 0 && l < 10);
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}

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

using namespace std;

int main(){
  int num,count;
  vector<int> v(4,0) ;
  while(cin >> num){
    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 == num){
              ++count ;
            }
          }
        }
      }
    }
    cout << count << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

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

C++: #include<iostream>
using namespace std;
int main(){
int n;
int num=0;
while(cin>>a){
for(int h=0;h<=9;h++){
for(int i=0;i<=9;i++){
for(int j=0;j<=9;j++){
for(int k=0;k<=9;k++){
if(h+i+j+k==a){num++;}
}
}
}
}
cout<<num<<endl;
num=0;
}
}

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

using namespace std;

int main (void) {
	int n, MAX = 9, count;
	
	while (scanf("%d", &n) != EOF) {
		count = 0;
		
		for (int a = 0; a <= MAX; a ++) {
			for (int b = 0; b <= MAX; b ++) {
				for (int c = 0; c <= MAX; c ++) {
					for (int d = 0; d <= MAX; d ++) {
						if (a + b + c + d == n) {
							count ++;
						}
					}
				}
			}
		}
		
		cout << count << endl;
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int c(int m,int n)
{
	int s=1;
	for(int i=0;i<m;i++)
		s=(s*(n-i))/(i+1);
	return s;
}
int main()
{
	int n,s;
	while(cin>>n)
	{
		s=0;
		if(n>18)n=36-n;
		s+=c(3,n+3);
		n-=9;
		while(n>0)
		{
			s-=c(2,n+1);
			n--;
		}
		cout<<s<<endl;
	}
	return 0;
}

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

int main(void)
{
    int n = 0;
    
    while(cin >> n){
        int ans = 0;
        if(n >= 37) continue;

        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++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;


int main()
{
	int n, counter = 0;
	while (scanf("%d", &n) != -1){
		counter = 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) counter++;
					}
				}
			}
		}
		cout << counter<<endl;
	}
	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;
		cout<<dp[n]<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main(){
  int n=0;
  int C=0;
  int a,b,c,d;
  
  while(scanf("%d",&n)!=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==n){
					  C++;
				  }
			  }
		  }
	  }
  }
  }
  cout<<C<<endl;
  
  return 0;
}

C++: #include <iostream>
#include <vector>
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 <stdio.h>
#include <string.h>

int dp[2][51];

int main()
{
	while(1)
	{
		int n;
		if(EOF == scanf("%d",&n))
		{
			break;
		}
		int now = 0;
		for(int i = 0; i <= 50; i++)
		{
			dp[now][i] = 0;
		}
		dp[now][0] = 1;
		for(int k = 0; k < 4; k++)
		{
			int nex = (now + 1) % 2;
			for(int i = 0; i <= 50; i++)
			{
				dp[nex][i] = 0;
			}
			for(int j = 0; j <= 50; j++)
			{
				for(int i = 0; i <= 9; i++)
				{
					if(j + i <= 50)
					{
						dp[nex][j + i] += dp[now][j];
					}
				}
			}
			now = nex;
		}
		printf("%d\n",dp[now][n]);
	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  vector<int> result;

  while (cin >> n) {
    if (n > 36 || n < 0) {
      result.push_back(0);
    } else {
      int tmp = 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)
                tmp++;
      result.push_back(tmp);
    }
  }
  for (int i = 0; i < result.size(); i++) 
    cout << result[i] << endl;
  return 0;
}