Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 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 i+j+k+l == a {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

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

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

    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 <iostream>
#include <cstdio>
using namespace std;

int main(int argc, const char * argv[])
{
    int n;
    while (cin >> n) {
        int cnt = 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) {
                            cnt++;
                        }
                    }
                }
            }
        }
        cout << cnt << endl;
    }
    return 0;
}

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

int main() {
  int a, b, c, d, n, count;
  while(cin >> n) {
    count = 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) count++;
    cout << count << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
#define FORMIN(N) ((N > 0) ? N : 0)
#define FORMAX(N) ((N > 9) ? 9 : N)

int main(void)
{
	int n, cnt;
	while(cnt = 0, cin >> n) {
		if(n > 36) {
			cout << 0 << endl;
			continue;
		}
	
		for(int a = FORMIN(n - 27); a <= FORMAX(n); a++) {
			for(int b = FORMIN((n - a) - 18); b <= FORMAX(n - a); b++) {
				for(int c = FORMIN((n - a - b) - 9); c <= FORMAX(n - a - b); c++) {
					cnt++;
				}
			}
		}

		cout << cnt << endl;
	}
	return 0;
}

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

using ll = long long;
#define debug(x) cerr << #x << ": " << x << endl;
#define line() cerr << "---------------" << endl;

int main() {
   int n;
   cin >> n;

   int cnt = 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) {
                  cnt++;
               }
            }


   cout << cnt << endl;

   return 0;
}

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

int main() {
	vector<int> count;
	int n;
	while (cin >> n) {
		int r = 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) r++;
					}
				}
			}
		}
		count.push_back(r);
	}
	for (int i = 0; i < count.size(); i++) {
		cout << count[i] << endl;
	}
}

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

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

int main(){
	int in,i[4],ans = 0,s[4] = {0,0,0,0};
	cin >> in;
	for(i[0] = 0;9 >= i[0];i[0]++){
		if(0 > in - i[0]) break;
		//cout << "[1]" <<  i[0] << endl;				
		for(i[1] = 0;9 >= i[1];i[1]++){
			if(0 > in - ( i[0] + i[1] ) ) break;
			//cout << "[2]" << i[1] << endl;
			for(i[2] = 0;9 >= i[2];i[2]++){
				if(0 > in - ( i[0] + i[1] + i[2] ) ) break;
				//cout << "[3]" << i[2] << endl;
				for(i[3] = 0;9 >= i[3];i[3]++){
					if(0 > in - ( i[0] + i[1] + i[2] + i[3] ) ) break;
					//cout << "[4]" << i[3] << endl;
					if(i[0] + i[1] + i[2] + i[3] == in){ans++;}
				}	
			}
		}
	}
	cout << ans << endl;
}

C++: #include<iostream>

using namespace std;

int count( int i, int n )
{
  if ( i == 4 )
    if ( n == 0 )
      return 1;
    else
      return 0;
  else
    {
      if ( n < 0 ) return 0;
      
      int ret = 0;
      for ( int j = 0; j < 10; j++ )
        {
          ret += count( i+1, n - j );
        }
      return ret;
    }
}

int main()
{
  int n;
  
  while ( cin >> n )
    cout << count(0, n) << endl;

  return 0;
}

C++: #include <iostream>
#include <vector>
 
int main(void) {
  int n;
  while (std::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++) {
          for (int l = 0; l <= 9; l++) {
            if(i + j + k + l == n)ans++;
          }
        }
      }
    }
    std::cout << ans << std::endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;
int countSolve(int a,int b,int n);
int solve(int n);

int main() {
	int n,i=0;
	int a[3];
	while (1) {
		cin >> n ;
		a[i] = solve(n);
		i++;

		if(i == 2) break ;
	}

	for(i=0;i<2;i++){
		cout << a[i] << endl;
	}

	return 0;
}

int countSolve(int a, int b, int n) {
	int x = n-a-b;
	int count = 0, i = 0 , j=0;
	for (i=0; i<10; i++) {
		for (j=0; j<10; j++) {
			if (x == i+j)
				count++;
		}
	 }
	return count;
}

int solve(int n) {
	int count = 0;
	for (int a=0; a<10; a++) {
		for (int b=0; b<10; b++) {
			count += countSolve(a,b,n);
		}
	}
	return count ;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
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(){ 
    Sumof4Integers inst;
    while(cin>>n){
        inst.solve();
        ans=0;
    }
}

C++: #include<iostream>

using namespace std;

int main(){
    int n,result=0;
    cin >> n;
    for (int a = 0; a <= 9; a++){
        for (int b = a; b <= 9; b++){
            for (int c = b; c <= 9; c++){
                for (int d = c; d <= 9; d++){
                    if (a + b + c + d == n)
                    {
                        result++;
                    }
                }
            }
        }
    }

    cout << result / 4 << endl;

    return 0;
}

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

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