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>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>

using namespace std;





int main()
{
	int n;
	int sum;
	int k[19];//k[i]???i?????????????¶?????????§??????????????¨?????????????????????
	while (cin >> n) {
		sum = 0;
		if (n > 36) {
			cout << "0" << endl;
			break;
		}
		else{
			
			for (int i = 0; i < 19; i++) {
				if (i < 10) {
					k[i] = i + 1;
				}
				else {
					k[i] = 19 - i;
				}
			}
			for (int i = max({0,n-18}); i <= min({ 18,n }); i++) {
				sum += k[i] * k[n - i];
			}
		}
		cout << sum << endl;
	}





}

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

int task(int n){
  int sum=0;
  if(n>36) return 0; if(n==36) return 1;

  for(int a=0;a<10;a++){
    if(n>(a+9+9+9)) continue;
    for(int b=0;b<10;b++){
      if(n>(a+b+9+9)) continue;
      for(int c=0;c<10;c++){
        if(n>(a+b+c+9))continue;
        for(int d=0;d<10;d++){
          if(n==(a+b+c+d)) sum++;
        }
      }
    }
  }
  return sum;
}

int main(){
  int n;
  while(cin>>n){
    int sum=0;
    sum=task(n);
    cout<<sum<<"\n";
  }
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <string>
#include <sstream>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repn(i, n) for(int i = 1; i <= (int)n; ++i)
#define pb push_back
#define lb lower_bound
#define mp make_pair
#define ite iterator
#define max2(x, y) ((x) > (y)) ? (x) : (y)
#define max3(x,y,z) max2((x), max2((y),(z)))
#define max4(v,w,x,y) max2(max2((v),(w)), max2((x),(y)))
#define min2(x, y) ((x) > (y)) ? (y) : (x)
#define min3(x,y,z) min2((x), min2((y),(z)))
#define min4(v,w,x,y) min2(min2((v),(w)), min2((x),(y)))
#define ul unsigned long
#define ull unsigned long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

template<typename T>
bool elem(set<T> st, T val){
	return (st.find(val) != st.end());
}

template<typename T>
void printv(vector<T> vt){
    rep(i, vt.size() - 1)
        cout << vt[i] << " ";
    cout << vt[vt.size() - 1] << endl;
}

typedef vector<int> vint;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef pair<int, int> pii;


int ans[51];
int main(void){
    int n;
    rep(i, 51) ans[i] = -1;
    while(cin >> n){
        int ret = 0;
        if(ans[n] >= 0){
            cout << ans[n] << endl;
            continue;
        }
        rep(a,10){
            rep(b,10){
                rep(c,10){
                    rep(d,10)
                        if(a+b+c+d==n) ret++;
                }
            }
        }
        cout << ret << endl;
        ans[n] = ret;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int counter=0;
for(int a=0;a<10;a++){
for(int b=0;b<10;b++){
for(int c=0;c<10;c++){
if(0<=n-a-b-c && n-a-b-c<=9){
counter++;
}
}
}
}
cout<<counter<<endl;
return 0;
}

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

using namespace std;


int count2=0;

void saiki(int a, int b,int n){
	
}

int main(){
	int n;
	int count2 = 0;
	

	function<int(int, int, int)> x = [=,&count2](int a, int b, int n)->int{
		if (b == 0){
			if (n == a)count2++;
		}
		else{
			for (int i = 0; i < 10; i++){
				saiki(a + i, b - 1, n);
			}
		}
	};

	
	while (cin >> n){
		x(0, 4, n);

		cout << count2 << endl;
	}
	return 0;
}

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

int main(){
  
  vector<int> count_array;
  int count;
  int in_num;
  int a,b,c,d,i=0;
  while(cin>>in_num){
    count=0;
    if(in_num>36)break;
    else{
      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)==in_num){
		count++;
	      }
	    }
	  }
	}
      }
      count_array.push_back(count);
      ++i;
    }
  }
  for(int j=0;j<i;j++){
    cout<<count_array[j]<<endl;
  } 
}

C++: #include <math.h>
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <string>

#define YES "YES"
#define NO "NO"
#define space ' '

using namespace std;

void func();

int main(void)
{
	
	func();

	return 0;
}


void func()
{
	

	int n, cnt;
	
	while (cin >> n, !cin.eof()){
		cnt = 0;

		for (int i = 0; i < 10; i++)
		{
			for (int ii = 0; ii < 10;ii++)
			{
				for (int iii = 0; iii < 10;iii++)
				{
					for (int iiii = 0; iiii < 10;iiii++)
					{
						if ((i + ii + iii + iiii) == n)
						{
							cnt++;
							break;
						}

					}
				}
			}
		}

		cout << cnt << endl;
	}
}

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

int main(){
    int n;
    
    while(cin>>n){
    int count=0;
    for(int i=0;i<10; i++){
        for(int s=0;s<10; s++){
            for(int t=0;t<10; t++){
                for(int w=0;w<10; w++){
                    if(i+s+t+w==n)count++;
                }
            }
        }
    }
        cout<<count<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int x,ans;
int main(){
for(){
ans=0;
cin>>x;
if(x=<0)return 0;
for(int i=0;i<10;i++){
for(int j=0;i<10;j++){
for(int k=0;k<10;k++){
if(x-(i+j+k)<10){
ans++;
}
}
}
}
cout<<ans;
}
return 0;
}

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


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

  return 0;
}

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

int main() {
    int cnt;
    while (1) {
        int num;
        cin >> num;
        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==num) {
                            cnt++;
                        }
                    }
                }
            }
        }
        printf("%d\n",cnt);
    }
    return 0;
}

C++: #include<iostream>
int main(){
	int n;
	while(std::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++){
					for(int l=0;l<10;l++){
						if(i+j+k+l==n)ans++;
					}
				}
			}
		}
		std::cout<<ans<<std::endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(void)
{
  int n;

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

  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
	int a;
	while (cin>>a)
	{
		int 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 == a) ans++;
					
			
			cout<<ans;
		
	}
	
	return 0;
}

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

int main(){

	int n,x;
	int i,j,k,l;

	while(std::cin >> n){
		x = 0;
		for(i=1;i<10;i++){
		for(j=1;j<10;j++){
		for(k=1;k<10;k++){
		for(l=1;l<10;l++){
			if(n == i + j + k + l){
				x++;
			}
		}
		}
		}
		}
		std::cout << x << std::endl;
	}
}