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<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 using namespace std;
 
 int kk[10*10];
 
 bool binary_search(int x)
 {
   int l=0,r=10*10;
   while(r-l>=1)
   {
     int i=(l+r)/2;
     if(kk[i]==x) return true;
     else if(kk[i]<x) l=i+1;
     else r=i;             
   }     
   return false;
 }

 int main()
 {
   int k;
   int a,b,c,d;
   while(cin>>k)
   {
     int count=0;
     for(a=0;a<10;a++)
     {
       for(b=0;b<10;b++)
       {
         kk[a*10+b]=a+b;                 
       }                 
     }          
     sort(kk,kk+100);
     for(c=0;c<10;c++)
     {
       for(d=0;d<10;d++)
       {
         if(binary_search(k-a-b)) count++;                 
       }                 
     }
     cout<<count<<endl; 
   }
   //while(1);      
   return 0;    
 }

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

using namespace std;

int solve(const int n) {
	set< vector<int> > s;
	vector<int> v(4);
	for (v[0] = 0; v[0] < 10; v[0]++)
		for (v[1] = 0; v[1] < 10; v[1]++)
			for (v[2] = 0; v[2] < 10; v[2]++)
				for (v[3] = 0; v[3] < 10; v[3]++) {
					int sum = 0;
					for (int i = 0; i < 4; i++) sum += v[i];
					if (sum == n) {
						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<stdio.h>
    int main(void){
    int i,j,k,l,n,m,cut;
    while(scanf("%d",&n)!=EOF){
    cut=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++){
                    m=i+j+k+l;
                    if(n==m){
                        cut++;
                    }
                }
            }
        }
    }
        printf("%d",cut);
    }
    return 0;
    }

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

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

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
int n, a, b, c, d, hasil;
int main(){
	while(cin >> n){
		hasil = 0;
		for(int j = 0; j <= 9; j++){
			for(int k = 0; k <= 9; k++){
				for(int l = 0; l <= 9; l++){
					for(int m = 0; m <= 9; m++){
						if(j + k + l + m == n){
							hasil++;
						}
					}
				}
			}
		}
		cout << hasil << "\n";	
	}
	return 0;
}

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

int main()
{
    int n, cnt;

    while(cin >> n) {
        cnt = 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)
                            cnt++;

      cout << cnt << endl;
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
int n,S;
int a[4];

while(cin>>n)
{
S=0;
a[0]=0;
a[1]=0;
a[2]=0;
a[3]=0;
for(int i=0;i<10;i++)
{
	a[0]=i;
	for(int j=0;j<10;j++)
{
	a[1]=j;
	for(int k=0;k<10;k++)
{
	a[2]=k;
		for(int l=0;l<10;l++)
{
	a[3]=l;
	if(a[0]+a[1]+a[2]+a[3]==n)
	{
		S++;
	}
}
}	
}
}
cout<<S<<endl;	
}
return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int a, b, c, d;
	int n;

	while(cin >> n){

	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){
						count = count +1;
					}
				}
			}
		}
	}

	cout << count <<endl;
}
}

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

int main(void) {
  int sum;
  while (scanf("%d", &sum)+1) {
    if (sum > 36) {
      printf("0\n");
    }

    int count = 0;
    int a = 0;
    int b = 0;
    int c = 0;
    int d = 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) == sum) count++;
          }
        }
      }
    }
    printf("%d\n", count);
  }
}

C++: #include<cstdio>
int ans=0;
int n;
class Sumof4Integers{
    public:
        void solve(){ 
            dfs(0,0);
            printf("%d\n",ans);
        }
        void dfs(int d,int sum){ 
            if(d==4){
                if(n==sum)ans++;
                return;
            }
            for(int i=0;i<10;i++){
                dfs(d+1,sum+i);
            }
        }
};
int main(){ 
    scanf("%d",&n);
    Sumof4Integers inst;
    inst.solve();
}

C++: #include<bits/stdc++.h>
using namespace std;
int n;
int main(){
	while(cin>>n){
		int ans=0;
		
		for(int a=0;a<10;a++){
			for(int b=0;b<10;b++){
				for(int i=0;i<10;i++){
					for(int j=0;j<10;j++){
						if(n==a+b+i+j){
							++ans;
						}
					}
				}
			}
		}
	cout<<ans<<endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int main() {
    int n[50] = {0};
    REP(a,10) {
        REP(b,10) {
            REP(c,10) {
                REP(d,10) {
                    if (a+b+c+d>0 && a+b+c+d<=50) n[a+b+c+d-1]++;
                }
            }
        }
    }
    
    int k;
    while(cin >> k) {
        cout << n[k-1] << endl;
    }
}

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



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

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

using namespace std;

int main(){
  int a,b,c,d,sum,n,count=0,num;
  vector<int> nl;
  while(cin >> n){
    nl.push_back(n);
  }

  for(int j=0; j<nl.size(); j++){
    count = 0;
    n = nl[j];
    for(int i=0; i < 10000; i++){
      num = i;
      a = num/1000;num%=1000;
      b = num/100;num%=100;
      c = num/10;num%=10;
      d = num;
      sum = a+b+c+d; 
      if(n == sum){
        count++;
      }
    }

    cout << count << endl;
  }
}