Go: package main
import (
	"fmt"
	"os"
	"strconv"
	"bufio"
)

var sc = bufio.NewScanner(os.Stdin)

func main(){
	for sc.Scan(){
		n := nextInt()
		cnt := 0
		for a:=0; a<=9; a++{
			for b:=0; b<=9; b++{
				for c:=0; c<=9; c++{
					for d:=0; d<=9; d++{
						if a+b+c+d==n{
							cnt++
						}
					}
				}
			}
		}
		fmt.Println(cnt)
	}
}

func next()string{
	//sc.Scan()
	return sc.Text()
}

func nextInt()int{
	a, _ := strconv.Atoi(next())
	return a
}

C++: #include <stdio.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int hierarchy(int num);

int main(void) {
    int num, count, i, j, k;
    
    while(scanf("%d", &num) != EOF) {
        int ans = 0;
        switch(hierarchy(num)) {
            case 1:
                j = 6;
                k = 4;
                count = 0;
                for(i = 4; num != count++; ) {
                    printf("i = %d\nj = %d\n", i, j);
                    ans = i; //
                    if(num == count) break;
                    if(count > 1) j += k++;
                    i += j;
                }
                break;
            case 2:
                j = 66;
                k = 1;
                count = 9;
                for(i = 282; num != count++; ) {
                    printf("i = %d\nj = %d\n", i, j);
                    ans = i;
                    if(num == count) break;
                    if(count > 10) {
                        j += k;
                        k -= 3;
                    }
                    i += j;
                }
                break;
            case 3:
                j = -41;
                k = -11;
                count = 19;
                for(i = 633; num != count++; ) {
                    printf("i = %d\nj = %d\n", i, j);
                    ans = i;
                    if(num == count) break;
                    if(count > 20) {
                        j += k;
                        k += 3;
                    }
                    i += j;
                }
                break;
            case 4:
                j = -28;
                k = 7;
                count = 29;
                for(i = 84; num != count++; ) {
                    printf("i = %d\nj = %d\n", i, j);
                    ans = i;
                    if(num == count) break;
                    if(count > 30) j += k--;
                    i += j;
                }
                break;
            default : break;
        }
        cout << ans << endl;
    }
    
    return(0);
}

int hierarchy(int num) {
    if(num >= 0 && num <= 9)
        return(1);
    else if(num >= 10 && num <= 19)
        return(2);
    else if(num >= 20 && num <= 29)
        return(3);
    else if(num >= 30 && num <= 36)
        return(4);
    else
        return(5);
}

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

using namespace std;

int main(){
	int n;
	while( scanf(" %d", &n) != EOF ){
		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;
					}
				}
			}
		}
	
		printf("%d\n", count);
	}

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,count;
	while(scanf("%d",&n)!=EOF){
		count=0;
		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++;
						}
					}
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

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

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

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

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;

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

int a,b,c,d;
int n;
int cou[55]={0};

int main(){
	rep(i,10) rep(j,10) rep(k,10) rep(l,10){
		cou[i+j+k+l]++;
	}
	while(cin>>n){
		cout<<cou[n]<<endl;
	}
	return 0;
}

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

namespace {

int combination(int a, int b, int c, int d)
{
  // (a,a,a,a)
  if (a == d) {
    return 1;
  }
  // (a,a,a,d) or (a,b,b,b)
  else if (a == c || b == d) {
    return 4;
  }
  // (a,a,c,c)
  else if (a == b && c == d) {
    return 6;
  }
  // (a,a,c,d) or (a,b,b,d) or (a,b,c,c)
  else if (a == b || b == c || c == d) {
    return 12;
  }
  // (a,b,c,d)
  else {
    return 24;
  }
}

int calc(int n)
{
  int com = 0;
  int a, b, c, d;

  for (a = 0; a <= 9; ++a) {
    if (a > n) break;
    for (b = a; b <= 9; ++b) {
      if (a + b > n) break;
      for (c = b; c <= 9; ++c) {
        if (a + b + c > n) break;
        for (d = c; d <= 9; ++d) {
          const int sum = a + b + c + d;
          if (sum == n) {
            com += combination(a, b, c, d);
          }
          else if (sum > n) {
            break;
          }
        }
      }
    }
  }

  return com;
}

} // unnamed namespace

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

  return 0;
}

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

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

}

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

int count = 0;
void dfs(int num, int tempsum, int sum) {
	if (sum < tempsum)
		return;
	if (num == 4) {
		if (tempsum == sum) {
			count++;
		}
		return;
	}

	for (int i = 9; i >= 0; i--) {
		dfs(num+1,tempsum + i,sum);
	}
}  

int main()  
{  
	int iSum = 0;
	while (cin >> iSum) {
		count = 0;
		dfs(0,0,iSum);
		cout << count << endl;
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: 
#include <iostream>

using namespace std;

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

C++: #include<stdio.h>

int main(){

int num,i,j,a,b,c,d;
int date[51]={0};


for(i=0;i<=9999;i++){
	
	a=i/1000;
	b=i%1000/100;
	c=i%100/10;
	d=i%10;
	date[a+b+c+d]++;

}


while(scanf("%d",&num)!=EOF){



printf("%d\n",date[num]);
}
return 0;
}

C++: #include<iostream>
using namespace std;
int x,ans;
int main(){
while(1){
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;
}
}