Go: package main

import "fmt"

var count int

func main() {
	var inputNum int
	for {
		fmt.Scanf("%d", &inputNum)
		fmt.Printf("%d\n", calcA(inputNum))
		count = 0
	}
}

func calcA(input int) int {
	for i := 0; i <= 9; i++ {
		calcB(input, i)
	}
	return count
}

func calcB(input, a int) {
	for i := 0; i <= 9; i++ {
		calcC(input, a, i)
	}
}

func calcC(input, a, b int) {
	for i := 0; i <= 9; i++ {
		calcD(input, a, b, i)
	}
}

func calcD(input, a, b, c int) {
	for i := 0; i <= 9; i++ {
		if a+b+c+i == input {
			count++
		}
	}
}

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;
			
		}
		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 <bits/stdc++.h>

using namespace std;

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

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

C++: include <iostream>

using namespace std;

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

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

using namespace std;

int main() {
	int n;

	while(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++;
						}
					}
				}
			}
		}

		cout << ans << endl;

	}
}

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



int main(void)
{
  int e,f=0;
  int i,j,k,l;
  double Max,Min,ans;
  vector<int> array;
  

  while(cin>>e)
    {
	 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==e)f++;}
			}}
	 }
    array.push_back(f);
	f=0;
    }
  i=0;
  while(i<array.size())
    {
	cout<<array[i]<<endl;
	i++;
    }
  array.clear();
}

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define sort(ss) sort(ss.begin(), ss.end())
#define rsort(ss) sort(ss.rbegin(), ss.rend())
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return acos(-1.0);
}
typedef set<int> set_i;
typedef set<string> set_s;
int INF=1000000;
int main(){
	int n,ans=0;
	int ss[10000]={};
	while(cin>>n){
		ans=0;
		if(n>37) cout<<0<<endl;
		else{
			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>
#include <stdio.h>
using namespace std;

int main() {
	int n;
	while(scanf("%d",&n)!=EOF){
		int ans=0;
		for(int i=0;i<10;i++){
			for(int j=0;j<10;j++){
				for(int k=0;k<10;k++){
					int l=n-i-j-k;
					if(0<=l&&l<=9)ans++;
				}
				
			}
		}
	cout << ans << endl;
	}

	
	
    	// your code goes here
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
  int n;
  int cnt = 0;

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

    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 == n){
	      cnt++;
	    }
	  }
	}
      }
    }
    cout << cnt << endl;
  }
}

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

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

C++: #include<iostream>
#include<stdio.h>
int main(){
	int a,b,c,d,n,i;

	std::cin>>n;
	i=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){
						i++;
			

						}
					}
				}
			}
		}
	std::cout<<i<<std::endl;

	system("pause");
	return 0;
	}

C++: #include<iostream>

using namespace std;
#define RENT 100000
int main(){
	int n, ans;
	int counter = 0;
	while (cin >> n){
		for (int i = 0; i < 10; i++){
			for (int q = 0; q < 10; q++){
				for (int w = 0; w < 10; w++){
					for (int e = 0; e < 10; e++){
						ans = i + q + w + e;
						if (ans == n){
							counter += 1;
						}
					}
				}
			}
		}
		cout << counter << endl;
	}
}

C++: #include <stdio.h>
#include <stdlib.h>

int main(void)
{
	int n;
	char buf[256];
	
	
	while (fgets(buf, 256, stdin){
		
		n = atoi(buf);
		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++;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	
	return (0);
}

C++: #include <stdio.h>

int main(void)
{
    int i,j,k,l,n,cnt;
    while(scanf("%d",&n)==1){
        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(n==(i+j+k+l))cnt++;
        printf("%d\n",cnt);
    }
    return 0;
}

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

void solve(int n) {
	int a, b, c, d, ans = 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) ans++;
				}
			}
		}
	}
	printf("%d\n", ans);
}

int main() {
	int n;
	while (n != NULL) {
		cin >> n;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;int main(){for(int i,c,k,n,j;cin>>n;k=0){for(i=0;i<1e4;c=0){for(j=i++;j>0;j/=10)c+=j%10;c-n?k:k++;}cout<<k<<endl;}}

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

int main(void) {
	int a[50];
	for (int i = 0; i < 50; i++) {
		while (cin >> a[i]) {
			int ans = 0;
			for (int x = 0; x < 10; x++) {
				for (int y = 0; y < 10; y++) {
					for (int z = 0; z < 10; z++) {
						for (int w = 0; w < 10; w++) {
							if (a[i] - x - y - z - w == 0) ans++;
						}
					}
				}
			}
			cout << ans << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int dp[40];
int main(){
    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++){
                    dp[i+j+k+l]++;
                }
            }
        }
    }
    int n;
    while(cin>>n){
        if(n==0){break;}
        cout<<dp[n]<<endl;
    }
    return 0;
}