Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

C++: #include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	while (scanf("%d", &n) != EOF){
		
		sum = 0;
		
		for (i = 0; i < 10; i++){
			for (j = 0; j < 10; j++){
				for (k = 0; k < 10; k++){
					for (h = 0; h < 10; h++){
						if (i + j + k + h == n){
							sum++;
						}
					}
				}
			}
		}
	
	
		printf("%d\n", sum);
	}
	return (0);
}

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

C++: 
#include <iostream>
#include <stdlib.h>
using namespace std;
#define thefor(i,end) for (i=0;i<=end;i++)
int main()
{    
	int n,a=0,b=0,c=0,d=0,end=9,con=0;
	while(cin>>n)
	{
		con=0;
		thefor(a,end)
		{
			thefor(b,end)
			{
				thefor(c,end)
				{
					thefor(d,end)
					{
						if(a+b+c+d==n)con++;
					}
				}
			}
		}
		cout<<con<<endl;
	}	
}

C++: #include<iostream>
using namespace std;
int s[51];
int main(){
	int i,j,k,l;
	int a;
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			for(k=0;k<10;k++){
				for(l=0;l<10;l++){
					s[i+j+k+l]++;
				}
			}
		}
	}
	while(cin>>a){
		cout<<s[a]<<endl;
	}
	return 0;
}

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

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

C++: #include <iostream>

using namespace std;

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

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    while(cin>>n){
        int ans=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) ++ans;
                }
            }
        }
        cout<<ans<<'\n';
    }
    return 0;
}

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

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

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

using namespace std;

int solve(const int n) {
	set< vector<int> > s;

	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) {
						vector<int> v(4);
						v[0] = a; v[1] = b; v[2] = c; v[3] = d;
						s.insert(v);
						break;
					}
	return s.size();
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	while (cin) {
		int n;
		cin >> n;
		cout << solve(n) << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    int N,cnt = 0;
    cin >> N;
    for(int i = 0;i <= 9;i++)for(int j = 0;j <= 9;j++)for(int k = 0;k <= 9;k++)
    if(N-i-j-k >= 0 && N-i-j-k <= 9)cnt++;
    cout << cnt << endl;
}

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

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

C++: #include <stdio.h>

int main() {
  
  int n, pattern;
  int i, j, k, l;
  
  while(1) {
    pattern = 0;
    if (scanf("%d", &n) == EOF) break;
    for (i = 0; i <= 9; i++) {
      for (j = 0; j <= 9; j++) {
        for (k = 0; k <= 9; k++) {
          for (l = 0; l <= 9; l++) {
            if (i + j + k + l == n) {
              pattern++;
              //printf("%d + %d + %d + %d = %d\n", i, j, k, l, n);
            }
          } 
        }
      } 
    }
    
    printf("%d\n", pattern);
  }
  return 0;
}

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    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++)
                    for(int d=0;d<=9;d++)
                        if(a+b+c+d == n) cnt++;
        
        cout << cnt << "\n";
    }
    return 0 ;
}

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

void calc(std::vector<int> &v) {
    std::vector<int> g(10, 0);
    for (int i = 1; i <= 9; i++) {
        v[i] = 4 * i; 
    }
    for (int i = 0; i <= 9; i++) {
        g[i] = 3 * i;
    }
    for (int i = 1; i <= 9; i++) {
        v[i + 9] = g[i] * 3 + (v[i + 8] - g[i - 1]);
    }
    return; 
}

int main(void) {
    std::vector<int> v(19, 0);
    calc(v);
    int total;

    while (std::cin >> total) {
        if (total > 36) {
            std::cout << 0 << std::endl;
        } else if (total > 18){
            total = 36 - total; 
            std::cout << v[total] << std::endl;
        } else {
            std::cout << v[total] << std::endl;
        }
    }
    return 0;
}

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

int main(){
	int n;
	int count;

	while (cin >> n){
		
		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 <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <iomanip>


using namespace std;

typedef unsigned long long ull;
int main(void) {
	int n, res = 0;
	while(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)res++;
	}	
	}	
	}	
	}
	cout << res << endl;
	}
}