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

C++: #include <iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
	int k,l,m,ans;
	cin>>n;
	for(a=0;a<min(10,n);a++){
		k = n-a;
		for(b=0;b<min(10,k);b++){
			l = k-b;
			for(c=0;c<min(10,l);c++){
				m = l-c;
				for(d=0;d<min(10,m);d++){
					ans++;
				}
			}
		}		
	}
	cout << ans << endl;
}

C++: #include <iostream>

using namespace std;

int main(){

	int n;
	int a , b , c , d;
	int ans , count = 0;

	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++){

						ans = a + b + c + d;
						if(ans == n){
							count++;
						}
					}
				}
			}
		}
	}

	cout << count << endl;

	return 0;
}

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

int main()
{
	int n,a,b,cnt=0;
	cin >> n;
	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++: #define _CRT_SECURE_NO_WARNINGS
#define M_PI 3.14159265358979
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include <algorithm>

using namespace std;


int main()
{
	int n, counter = 0;
		while (scanf("%d", n) == -1){
		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) counter++;
					}
				}
			}
		}
		cout << counter << endl;
	}
	return 0;
}

C++: #include <cstdio.h>
#include <algorithm>

using namespace std;
int main(void)
{
	int i, j, k, h, n;
	int sum = 0;
	
	scanf("%d", &n);
	
	for (i = 0; i < 10; i++){
		for (j = 0; j < 10; j++){
			for (k = 0; k < 10; k++){
				for (h = 0; h < 10; h++){
					if (i + j + k + h == n){
						sum++;
					}
				}
			}
		}
	}
	
	printf("%d\n", sum);
	
	return (0);
}

C++: #include<stdio.h>
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        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++;
        printf("%d\n",count);
    }
    return 0;
}

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

int ans = 0;

void SofI(int num, int n) {
	if (num > n * 9) { return; }
	else if (num < 0) { return; }
	else if (num != 0 && n == 0) { return; }
	else if (num == 0) {
		ans++;
		return;
	}
	else {
		for (int i = 0; i < 10; i++) {
			SofI(num - i, n - 1);
		}
	}

}

int main(void) {
	int num;
	cin >> num;
	SofI(num, 4);
	cout << ans << endl;
	return 0;
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    int n;
    int i, j, k;
    int ans = 0;
    while (cin >> n)
    {
        ans = 0;
        i = 0;
        j = 0;
        k = 0;
        rep(i, 10)
        {
            rep(j, 10)
            {
                rep(k, 10)
                {
                    if (0 <= n - i - j - k && n - i - j - k <= 9)
                    {
                        ans++;
                    }
                }
            }
        }
        cout << ans << endl;
    }
}

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

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

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

const double interest = 0.05;
const int roundYen = 1000;

int weeklyAdd(int debt) {
  debt = debt * (1 + interest);
  debt = ceil(debt / roundYen) * roundYen;
  std::cout << debt << '\n';
  return debt;
}

int main(int argc, char const *argv[]) {
  // int week = 5;
  int week;
  std::cin >> week;
  int debt = 100000;

  for (size_t i = 0; i < week; i++) {
    debt = weeklyAdd(debt);
  }

  return 0;
}

C++: #include <stdio.h>

int main( void ){
    int nCount = 0;
    int n;
    while( true ){
    scanf( "%d",&n );
    if( n == NULL ) break;

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

    printf( "%d\n",nCount );
    }
    return 0;
}

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



int main(void){	

	int n,count;
	while (cin >> n){
		count = 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){
							count++;
						}

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

	}
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n,i,j,k,l,ans = 0;

    while(cin >> n){

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
	for(;;){
		int s,f = 0;
		if(scanf("%d",&s) == EOF){break;}
		for(int i=0; i<10; i++) for(int l=0; l<10; l++) for(int m=0; m<10; m++) for(int n=0; n<10; n++) if(i+l+m+n == s){f++;}
		cout <<f<<endl;
	}
	return 0;
}

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

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

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  int i, j, k, l, sum, count = 0;

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

  cout << count << endl;

  return 0;
}