Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
	}
	for _, value := range resultArr {
		fmt.Println(value)
	}
}

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 <bits/stdc++.h>
using namespace std;

int main() {
	ios :: sync_with_stdio(false);
	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 << '\n';
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int N;
 
int solve(){
    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){
                    int tmp = i + j + k + l;
                    if(tmp == N) ans++;
                }
            }
        }
    }
    return ans;
}
 
int main(){
    while(cin >> N){
        int ans = solve();
        cout << ans << endl;
    }
}

C++: #include<iostream>
using namespace std;
#define RENT 100000
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++){
                    for(int d=0;d<10;d++){
                        if(a+b+c+d==n)ans++;
                    }
                }
            }
        }
         
        cout<<ans<<endl;
    }
}

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

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

  if (n % 4 == 0) cout << 1 << endl;
  else cout << 4 << endl;

  return 0;
}

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

int keta(int x){
	int i=0;
	while (x/pow(10,i)>=1){
		i++;
	}
	if (x==0){
		return 1;
	}
	else
	return i;
	}


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++){
		   if (0<=n-i-j-k&&n-i-j-k<10){
			   count+=1;
		   }

		   }
	   }
	}
cout<<count<<endl;
}
	}

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

using namespace std;

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

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
int n;
int count;

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

    cout<<count<<endl;
return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	for(int x;cin>>x;)
	{
		if(x<0 || x >36) break;
		if(x>18)
			x=36-x;
		int sum=1;
		for(int i=1;i<=x;i++)
		{
			int a=(1+i+1)*(i+1)/2;
			sum +=a;
		}
		cout<<sum<<endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int n;
	while(cin>>n){
		int count = 0;
		REP(i, 10)
			REP(j, 10)
			REP(k, 10)
			REP(l, 10)
			if (i + j + k + l == n)count++;
		cout << count << endl;
	}
}

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

#define ll long long int

#define rep(p,q) for(int i = p; i < q;i++)


//8
int main(void) {
	int n;
	while (cin >> n) {
		if (n > 36) cout << 0 << endl;
		else {
			int ans = 0;
			for (int i = 0; i < 10; i++) {
				int sum = i;
				for (int j = 0; j < 10; j++) {
					sum = i;
					sum += j;
					if (sum > n)continue;
					for (int k = 0; k < 10; k++) {
						sum = i + j;
						sum += k;
						if (sum > n)continue;
						for (int l = 0; l < 10; l++) {
							sum = i + j + k;
							sum += l;
							if (sum == n) ans++;
						}
					}
				}
			}
			cout << ans << endl;
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <cmath>

using namespace std;

const int N = 1e6 + 10; 
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;

struct node {
    int x, y;
    bool operator < (const node &a) const {
        if (x != a.x) return x < a.x;
        else return y < a.y; 
    }
};

node s[N], t[N];


int c[111];
bool cmp1(const node &a, const node &b) {
    if (a.x != b.x) return a.x > b.x;
    else return a.y > b.y;
}

int main() {
    int n, m;
    while (scanf("%d%d", &n, &m) != EOF) {
        int ma = 0;
        for (int i = 1; i <= n; ++i) scanf("%d%d", &s[i].x, &s[i].y), ma = max(ma, s[i].y);
        for (int i = 1; i <= m; ++i) scanf("%d%d", &t[i].x, &t[i].y);
        sort(s + 1, s + n + 1, cmp1);
        sort(t + 1, t + m + 1, cmp1);
        int num = 0;long long ans = 0;
        memset(c, 0, sizeof(c));
        int id = 1;
        for (int i = 1; i <= m; ++i) {
            while (id <= n && s[id].x >= t[i].x) {
                ++c[s[id].y];
                ++id;
            }
            for (int j = t[i].y; j <= ma; ++j) {
                if (c[j] != 0) {
                    --c[j];
                    ++num;
                    ans += t[i].x * 500 + t[i].y * 2;
                    break;
                }
            }
        }
        printf("%d %I64d\n", num, ans);
    }
    return 0;
}

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

int main(void) {
  int in;
  int table[51];

  memset(table, 0, sizeof(table));
  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++) {
          table[a + b + c + d]++;
        }
      }
    }
  }
  while(cin) {
    cin >> in;
    cout << table[in] << endl;
  }
  return 0;
}