Go: package main

import (
        "fmt"
)

func main() {
        var n int
        for {
                _, err := fmt.Scanf("%d", &n)
                if err != nil {
                        break
                }
                cnt := 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 a+b+c+d == n {
                                                        cnt++
                                                }
                                        }
                                }
                        }
                }
                fmt.Printf("%d\n", cnt)
        }
}

C++: #include "stdio.h"

int main()
{
	int n, m, l;

	while(scanf("%d", &n) != EOF){
		m = n;
		l = 0;

		for (int a = 0; a < 10; a++){
			if (m < a) break;
			else m -= a;
			for (int b = 0; b < 10; b++){
				if (m < b) break;
				else m -= b;
				for (int c = 0; c < 10; c++){
					if (m < c) break;
					else m -= c;
					for (int d = 0; d < 10; d++){
						if (m < d) break;
						else if(m == d) l++;
					}
					m += c;
				}
				m += b;
			}
			m += a;
		}

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

	return 0;
}

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

int main(void)
{
  int n;

  
  while(1)
    {
      cin >> n;
      if(cin.eof()) 
	break;

      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 <cstdio>

int count_combinations_of_sums(int n, int num_rests) {
  printf("%d %d\n", n, num_rests);
  if (num_rests * 9 < n) { return 0; }
  if (num_rests == 1) { return 1; }
  int count = 0;
  for (int i = 0; i <= 9 && i <= n; ++i) {
    count += count_combinations_of_sums(n - i, num_rests - 1);
  }
  return count;
}

int main() {
  int n;
  while (true) {
    if (scanf("%d", &n) != 1) { break; }
    printf("%d\n", count_combinations_of_sums(n, 4));
  }
  return 0;
}

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

using namespace std;

int n, s;
int dp[10][100][10];
int solve(int i, int j, int k);

int main(void){
	
	while(cin >> n >> s){
		if(n == 0 && s == 0){break;}
		fill_n(**dp,10*100*10,-1);
		cout << solve(0,0,10) << endl;
	}
}

int solve(int now, int sum, int b1){
	if(now == n){
		if(sum == s){return 1;}
		else return 0;
	}
	if(dp[now][sum][b1] != -1){return dp[now][sum][b1];}
	int t = 0;
	for(int i = 0; i < 10; i++){
		if(b1 != 10 && b1 >= i){continue;}
		t += solve(now+1, sum + i, i);
	}
	return dp[now][sum][b1] = t;
}

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;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
  int pair[100];
  int input;
  
  for(int i = 0; i < 10; i++)
    for(int j = 0; j < 10; j++)
      pair[i * 10 + j] = i + j;


  while(cin >> input){
    int count = 0;
    if(input > 36){
      continue;
    } else {
      for(int i = 0; i < 100; i++){
	int cd = input - pair[i];
	
	if(cd <= 18){
	  for(int j = 0; j < 100; j++) if(pair[j] == cd)
	      count++;
	}
      }
    }
    
    cout << count << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <utility>
#include <string>

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

typedef unsigned long ul;

using namespace std;

int main(){
	int n,count;
	while(cin >> n){
		REP(a, 10){
			REP(b, 10){
				REP(c, 10){
					REP(d, 10){
						if(a+b+c+d == n)
							count++;
					}
				}
			}
		}
		cout << count << endl;
		count = 0;
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
long nn[]={1,4,10,20,35,56,84,120,165,220,282,348,415,480,540,592,633,660,670,
660,633,592,540,480,415,348,282,220,165,120,84,56,35,20,10,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(;;){
cin>>n;
if(cin.eof())break;
cout<<nn[n]<<endl;
}
return 0;
}

C++: #include <cstdio>

int main()
{
	int n;
	int i,j,k,l;
	int ans[51];
	for(i = 0; i < 51; i++){
		ans[i] = 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++){
					ans[i + j + k + l]++;
				}
			}
		}
	}
	scanf("%d",&n);
	if(n < 0){
		printf("0\n");
	}
	printf("%d\n",ans[n]);
	return 0;
}

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

int main () {

int n, count = 0;

    cin >> n;

for (int a = 0; a < 10 && a <= n; a++){
    for (int b = 0; b < 10 && b <= n-a; b++){
        for (int c = 0; c < 10 && c <= n-a-b; c++){
            if (n-a-b-c >=0 && n-a-b-c < 10) {
                count++;
            }
        }
    }
}


    cout << count;


    return 0;

}

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

int n[50];

int main(){
    int input = 0;
    while(cin >> n[input]){
        if(n[input] == EOF) break;
        input++;
    }
    for(int h = 0; h < input; h ++){
        int c = 0;
        for (int i = 0; i < 10; i++)
        {
            for (int j = 0; j < 10; j++)
            {
                for (int k = 0; k < 10; k++)
                {
                    if (n[h] - (i + j + k) >= 0 && n[h] - (i + j + k) < 10)
                        c++;
                }
            }
        }
        cout << c << endl;
    }
    return 0;
}

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

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

int main() {
	
	int n;
	
	while(cin >> n){
		int ans = 0;
		for(int a = 0; a < 10; a++){
			for(int b = 0; b < 10; b++){
				for(int c = 0; c < 10; c++){
					int d = n - a - b- c;
					if(0 <= d && d <= 9) ans++;
				}
			}
		}
		cout << ans << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>
#include <set>
#include <utility>

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>
using namespace std;
int main(){
  int n;
  while(scanf("%d",&n)!= EOF){
    int ans  = 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 == n)ans++;
	  }
	}
      }
    }
    cout << ans << endl;
  }
}

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++) {
                    for (int d = 0; d <= 9; d++) {
                        if ((a + b + c + d) == n){
                            cnt ++;
                        }
                    }
                }
            }
        }
        cout << cnt << endl;
    }
    return 0;
}