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(int argc, char* argv[])
{
	int a, b, c, d, n, count;

	while(cin >> n){
		count = 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){
							count++;
							break;
						}
						if((a + b + c + d) > n){
							break;
						}
					}
					if((a + b + c) > n){
						break;
					}
				}
				if((a + b) > n){
					break;
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}

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

int main(){
	int n;
	while(cin >> n){
		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 << "\n";
}
	return 0;
	
}

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

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

    return 0;
}

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

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

using namespace std;

typedef pair<int ,int > P;

int n,ans;

int main()
{
	while(cin>>n)
	{
		rep(a,10) rep(b,10) rep(c,10) rep(d,10) if(a+b+c+d==n) ans++;
		cout<<ans<<endl;
	}


	return 0;
}

C++: #include <iostream>
using namespace std;
 
int main() {
	int n;
	int count = 0;
	cin >> n;
	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 >=0 && n - i - j - k <= 9) count++;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long int ll;

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++){
                    for(int l=0;l<10;l++){
                        if((i+j+k+l)==n)ans++;
                    }
                }
            }
        }
        cout << ans << endl;
    }
}

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

using namespace std;

int main (void) {
	int n, MAX = 9, count;
	
	while (scanf("%d", &n) != EOF) {
		count = 0;
		
		for (int a = 0; a <= MAX; a ++) {
			for (int b = 0; b <= MAX; b ++) {
				for (int c = 0; c <= MAX; c ++) {
					for (int d = 0; d <= MAX; d ++) {
						if (a + b + c + d == n) {
							count ++;
						}
					}
				}
			}
		}
		
		cout << cout << endl;
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    //freopen("in.txt","r",stdin);
    //ios::sync_with_stdio(false);
    int n,i,j,k,l,c=0;
    while(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)
                            c++;
        cout << c << endl;
        c=0;
    }
    return 0;
}

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

int main(){

	int n, t, ans;

	while(cin >> n) {
		ans = 0;
		for(int a = 0; a < 10; a++) {
			for(int b = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					t = n - a - b - c;
					if(t >= 0 && t <= 9)
						ans++;
				}
			}
		}
		cout << ans << endl;
	}

    return 0;
}

C++: #define scanf_s scanf
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
#define MAX 20
int main(void)
{
	int n, cou;
	int i = 0, j = 0, l = 0, k = 0;
	while (scanf_s("%d", &n) != EOF) {
		for (int i = 0; i <= 9 && i <= n; ++i) {
			for (int j = 0; j <= 9 && i + j <= n; ++j) {
				for (int l = 0; l <= 9 && i + j + l <= n; ++l) {
					for (int k = 0; k <= 9 && i + j + l + k <= n; ++k) {
						if (i + j + l + k == n) ++cou;
					}
				}
			}
		}
		printf("%d\n", cou);
		cou = 0;
	}
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
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++) {
                    for (int l=0;l<10;l++) {
                        if (i+j+k+l==n) ans++;
                    }
                }
            }
        }
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#define a(i,b) for(int i=0;i<b;i++)
using namespace std;
int main() {
    int n,c;
    while(scanf("%d",&n)!=EOF){
    	c=0;
    	a(i,10)a(j,10)a(k,10)a(h,10)if(i+j+k+h==n)c++;
    cout<<c<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	while (cin >> n){
		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 == n){
							c++;
						}
					}
				}
			}
		}
		cout << c << endl;
	}
	return 0;
}

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

#define ascent(i, a, b) for(int (i) = (a); (i) < (b); (i) ++)

using namespace std;

int main() {
  int tmp;
  vector<int> n;
  while(cin >> tmp) {
    n.push_back(tmp);
  }

  ascent(i, 0, n.size()) {
    int ans = 0;
    ascent(a, 0, 10) {
      ascent(b, 0, 10) {
	ascent(c, 0, 10) {
	  ascent(d, 0, 10) {
	    if(a + b + c + d == n[i]) {
	      ans ++;
	    }
	  }
	}
      }
    }
    cout << ans << endl;
  }
  
  return 0;
}

C++: #include<stdio.h>

int main()
{
int n,con;
con=0;
while(scanf(" %d",&n)!=EOF)
{
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)con++;
printf("%d\n",con);
con=0;
}
return 0;

}

C++: #include <iostream>

using namespace std;

int main()
{
    int a,b,c,d,count;
int n;

for(int j=0;j<5;j++){
cin>>n;

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

                }}}}

    cout<<count<<endl;

}
    return 0;
}

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

int main()
{
	int n, a, b, c, d, cnt = 0;
	while (scanf("%d", &n) != EOF)
	{
		cnt = 0;
		if (n > 36)
		{
			printf("0\n");
			continue;
		}
		for (a = 0; a < 10; a++)
		{
			if (n - a>27)continue;
			for (b = a; b < 10; b++)
			{
				if (n - a - b > 18)continue;
				for (c = b; c < 10; c++)
				{
					if (n - a - b - c > 9)continue;
					for (d = c; d < 10; d++)
					{
						if (a + b + c + d == n)
						{
							if ((a == b) && (a == c) && (a == d))cnt++;
							else if (((a == b) && (b == c)) | ((b == c) && (c == d)))cnt += 4;
							else if ((a == b) | (b == c) | (c == d))cnt += 12;
							else cnt += 24;
						}
					}
				}
			}
		}

		printf("%d\n", cnt);
	}
}