Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	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
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

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



int main() {
	int a, b, c, d, n;
	int k = 0;
	while (cin >> n) {for (a = 0; a <= 9; a = a + 1) {for (b = 0; b <= 9; b = b + 1) {for (c = 0; c <= 9; c = c + 1) {for (d = 0; d <= 9; d = d + 1) {if (a + b + c + d == n) {
k += 1;}}}}}}cout << k << endl;return 0;}

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

int integar(int n);

int main(){
    int n;
    while(cin >> n){
        cout << integar(n) << endl;
    }
}

int integar(int n){
    int sum=0;
    int i,j,k,l;
    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)
                        sum++;
                }
            }
        }
    }
    return sum;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ans;
  while(cin >> n && n != EOF){
    ans = 0;
    for(int i1 = 0;i1 <= 9;i1++){
       for(int i2 = 0;i2 <= 9;i2++){
	  for(int i3 = 0;i3 <= 9;i3++){
	     for(int i4 = 0;i4 <= 9;i4++){
	       if(n == i1 + i2 + i3 + i4)ans++;
	     }
	  }
       }
    }
    cout << ans <<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include <sstream>
using namespace std;
int main(void){
    int n,ans,i,j,k,l;
    while(cin >> n){
    ans = 0;
    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){
                        ans++;
                    }
                }
            }
        }
    }
    cout << ans << endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,count=0,n2,count2=0;
	scanf("%d %d",&n,&n2);
	for(int f1=0;f1<10;f1++){
		for(int f2=0;f2<10;f2++){
			for(int f3=0;f3<10;f3++){
				for(int f4=0;f4<10;f4++){
					if(f1+f2+f3+f4==n){
						count++;
					}
				}
			}
		}
	}
	for(int f1=0;f1<10;f1++){
		for(int f2=0;f2<10;f2++){
			for(int f3=0;f3<10;f3++){
				for(int f4=0;f4<10;f4++){
					if(f1+f2+f3+f4==n){
						count2++;
					}
				}
			}
		}
	}
	printf("%d\n%d\n",count,count2);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans=0;
	cin>>n;
	for(a=0;a<min(10,n);a++){
		k = n-a;
		for(b=0;b<min(10,k);b++){
			l = k-b;
			for(c=0;c<min(10,l);c++){
				m = l-c;
				for(d=0;d<min(10,m);d++){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

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

int main(){
	int n;
	while(cin >> n){
		int ans = 0;
		for(int i = 0 ; i <= 9 ; i++){
			for(int j = 0 ; j <= 9 ; j++){
				for(int k = 0 ; k <= 9 ; k++){
					int l = n - i - j - k;
					if( 0 <= l and l <= 9 ) ans++;
				}
			}
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) cerr << #x << "=" << static_cast<bitset<16> >(x) << endl;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
using namespace std;
typedef long long  ll;

int main()
{
	int n;
	
	while (cin>>n) {
		int ans=0;
		rep(i, 10) {
			rep(j, 10) {
				rep(k, 10) {
					if (n-i-j-k>=0 && n-i-j-k<10)
						ans++;
				}
			}
		}
		cout << ans << endl;
	}
}

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

C++: //#define scanf_s scanf
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
#define MAX 20
int main(void)
{
	int n,cou = 0;
	int i = 0, j = 0, l = 0, k = 0;
	while (scanf_s("%d", &n) != EOF) {
		for (int i = 0; i <= 9 && i <= n; ++i) {
			for (int j = 0; j <= 9 && i + j <= n; ++j) {
				for (int l = 0; l <= 9 && i + j + l <= n; ++l) {
					for (int k = 0; k <= 9 && i + j + l + k <= n; ++k) {
						if (i + j + l + k == n) ++cou;
					}
				}
			}
		}
		printf("%d\n", cou);
		cou = 0;
	}
}

C++: #include<iostream>

using namespace std;

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

C++: #include <iostream>

int count_pattern( unsigned int const& n )
{
    int ans=0;
    for ( unsigned int a = 0; a < 10; ++a )
    {
        for ( unsigned int b = 0; b < 10; ++b )
        {
            for ( unsigned int c = 0; c < 10; ++c )
            {
                for ( unsigned int d = 0; d < 10; ++d)
                {
                    if ( a+b+c+d == n ) ++ans;
                }
            }
        }
    }
    return ans;
}

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

C++: #include<stdio.h>
int main(void){
  int n,a=0,b=0,c=0,d=0,i=0;
  while(scanf("%d",&n)!=EOF){
    i=0; 
   for(a=0;a<10;a++){
      for(b=0;b<10;b++){
	for(c=0;c<10;c++){
	  for(d=0;d<9;d++){
	    if(c<10 && b<10){
	    if(a+b+c+d==n){
	      i++;
	    }
	    }
	  }
	  if(c<10 && b<10){
	  if(a+b+c+d==n){
	    i++;
	  }
	  }
	}
	if(c<10 && b<10){
	if(a+b+c+d==n){
	  i++;
	}
	}
      }
      if(c<10 && b<10){
      if(a+b+c+d==n){
	i++;
      }
      }
   }
    printf("%d\n",i);
  }
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;
    while(1){
        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>

using namespace std;
int n;
int bfs(int now,int d){
	int ans=0;
	if(d==4){
	if(now==n)return 1;
	else return 0;
	}
	else{
	for(int i=0;i<10;i++)ans+=bfs(now+i,d+1);
	}
	return ans;
}

int main(){
	cin>>n;
	cout<<bfs(0,0)<<endl;
}

C++: #include<iostream>
using namespace std;
int n,num;
void dfs(int sum,int dept){
  if(dept==4){
    if(sum==n)
      num++;
    return;
  }
  for(int i=0;i<=9;i++)
    dfs(sum+i,dept+1);
}
int main(){
  while(cin>>n){
    num=0;
    for(int i=0;i<=9;i++)
      dfs(i,1);
    cout<<num<<endl;
  }
  return 0;
}