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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    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++){
                    int d=n-a-b-c;
                    if(0<=d&&d<=9) ++ans;
                }
            }
        }
        cout<<ans<<'\n';
    }
    return 0;
}

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

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

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

using namespace std;

int solve(const int n) {
	set< vector<int> > s;

	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) {
						vector<int> v(4);
						v[0] = a; v[1] = b; v[2] = c; v[3] = d;
						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<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    int N,cnt = 0;
    cin >> N;
    for(int i = 0;i <= 9;i++)for(int j = 0;j <= 9;j++)for(int k = 0;k <= 9;k++)
    if(N-i-j-k >= 0 && N-i-j-k <= 9)cnt++;
    cout << cnt << endl;
}

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

int main()
{
	int n,a,b,cnt;
	while(~scanf("%d",&n)){
		cnt=0;
		for(a=0;a<=18;a++){
			for(b=0;b<=18;b++){
				if(a+b==n) cnt+= (10-(int)abs(a-9)) * (10-(int)abs(b-9));
			}
		}
		cout << cnt << endl;
	}
	return 0;	
}

C++: #include <stdio.h>

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

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    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 << "\n";
    }
    return 0 ;
}

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

void calc(std::vector<int> &v) {
    std::vector<int> g(10, 0);
    for (int i = 1; i <= 9; i++) {
        v[i] = 4 * i; 
    }
    for (int i = 0; i <= 9; i++) {
        g[i] = 3 * i;
    }
    for (int i = 1; i <= 9; i++) {
        v[i + 9] = g[i] * 3 + (v[i + 8] - g[i - 1]);
    }
    return; 
}

int main(void) {
    std::vector<int> v(19, 0);
    calc(v);
    int total;

    while (std::cin >> total) {
        if (total > 36) {
            std::cout << 0 << std::endl;
        } else if (total > 18){
            total = 36 - total; 
            std::cout << v[total] << std::endl;
        } else {
            std::cout << v[total] << std::endl;
        }
    }
    return 0;
}

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

int main(){
	int n;
	int count;

	while (cin >> n){
		
		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 <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <iomanip>


using namespace std;

typedef unsigned long long ull;
int main(void) {
	int n, res = 0;
	while(cin >> n){
	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)res++;
	}	
	}	
	}	
	}
	cout << res << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#ifndef typeof
#define typeof __typeof__
#endif // typeof

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++)
#define repby(i, a, b, step) for(typeof(b) i = (a); i < (b); i += (step))
#define repab(i, a, b) repby(i, (a), (b), 1)
#define rep(i, n) repab(i, 0, (n))
#define pb push_back
#define sz(c) int((c).size())

int nsums(int n, int x)
{
  int res = 0;

  for (int a = 0; a < x; a++) {
    for (int b = a; b < x; b++) {
      for (int c = b; c < x; c++) {
        for (int d = c; d < x; d++) {
          if (a + b + c + d == n) {
            vi v;
            v.pb(a); v.pb(b); v.pb(c); v.pb(d);
            do {
              res++;
            } while (next_permutation(all(v)));
          }
        }
      }
    }
  }
  return res;
}

int main(int argc, char **argv)
{
  int n;

  while (cin >> n) {
    cout << nsums(n, 10) << endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int solve(int 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++){
                if(n-i-j-k>-1&&n-i-j-k<10)ans++;
            }
        }
    }
    return ans;
}
int main(){
    int n;
    while(cin>>n){
        cout<<solve(n)<<endl;
    }
    return 0;
}

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

int main(){

  int n = 0;
  while(cin >> n){
  int count = 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(n == i+j+k+l){
	    count++;
	  }
	}
      }
    }
  }
  cout << count << endl;
  }


  return 0;
}

C++: #include <iostream>

int main()
{
	int i, j, k, l;
	int n;
	int count = 0;
	
	std::cin >> n;
	
	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 == n) {
						count++;
					}
				}
			}
		}
	}
	
	std::cout << count << std::endl;
	
	return 0;
}

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

int main(){

  int n,count=0;

  while(cin >> n){

    count=0;

    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	for(int s=0;s<10;s++){
	  for(int t=0;t<10;t++){
	    if(i+j+s+t==n) count++;
	  }
	}
      }
    }

    cout << count << endl;
  }
}