Go: package main

import (
        "fmt"
)

func main() {
        var n int
        for {
                _, err := fmt.Scanf("%d", &n)
                if err != nil {
                        break
                }
                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++
                                                }
                                        }
                                }
                        }
                }
                fmt.Printf("%d\n", cnt)
        }
}

Python: #!/usr/bin/env python
# -*- conding: utf-8 -*-
import itertools
import sys
import math

for line in sys.stdin.readlines():
    n = int(line.strip())
    if n == 36:
        print(1)
        continue
    if n > 36:
        print(0)
        continue
    cnt = 0
    cmbs = itertools.combinations_with_replacement(range(0,10), 4)
    for cmb in cmbs:
        if sum(cmb) == n:
            if len(set(cmb)) == 1:
                cnt += 1
            elif len(set(cmb)) == 2:
                cnt += math.factorial(2) * 2
            elif len(set(cmb)) == 3:
                cnt += math.factorial(3)
            elif len(set(cmb)) == 4:
                cnt += math.factorial(4)
    print(cnt)

Python: def rec(i,n):
    r=0
    if i==4:
        return 1 if n==0 else 0
    for m in range(10):
        r+=rec(i+1,n-m)
    return r
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: #!/usr/bin/env python3
import itertools
import sys


def operation(n):
    count = 0
    for a, b, c, d in itertools.product(range(10), repeat=4):
        if a + b + c + d == n:
            count += 1
    print(count)


def main():
    for l in sys.stdin:
        n = int(l.strip())
        operation(n)


if __name__ == '__main__':
    main()

Python: INF=-1
memo=[[INF]*51 for i in range(5)]
def rec(i,n):
    if memo[i][n]!=INF:
        return memo[i][n]
    if i==4:
        return 1 if n==0 else 0
    for m in range(10):
        memo[i][n]+=rec(i+1,n-m)
    return memo[i][n]
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: import sys
dataset = sys.stdin.readlines()
for n in dataset:
	n = int(n)
	counter = 0
	for a in range(10):
		for b in range(10):
			for c in range(10):
				for d in range(10):
					if a + b + c + d == n:
						counter += 1
	print(counter)

Python: import sys
a=[0]*51
for i in range(19):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-[0,a[i-10]*4][i>9]
for e in sys.stdin:print(a[int(e)])

Python: import sys
try:
    while True:
        n = int(input())
        
        res = 0
        
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for m in range(10):
                        if i + j + k + m == n:
                            res += 1
        
        print(res)
except Exception:
    sys.exit()

Python: import sys
a=[0]*51
for i in range(10):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6
for i in range(10,19):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-a[i-10]*4
for e in map(int,sys.stdin):print(a[e])

Python: import sys
  
n = [0]*51
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                n[i+j+k+l] += 1

for i in sys.stdin:
    print(n[int(i)])

Python: import itertools, sys

d = {i: 0 for i in range(51)}
for i in itertools.combinations_with_replacement(range(0,10), 4):
    d[sum(i)] += 1
print(d)
for i in map(int, sys.stdin):
    print(d[i]*4)

Python: n=int(input())
cnt=0
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if i+j+k+l==n:
                    cnt=cnt+1
                    print(i,j,k,l)

print(cnt)

Python: num = [0 for i in range(51)]
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                num[a+b+c+d] += 1
while 1:
    try:
        print(num[int(input())])
    except:
        break

Python: while True:
  try:
    n = int(input())
    ans =0
    for a in range(10):
      for b in range(10):
        for c in range(10):
          for d in range(10):
            if a+b+c+d==n:
              ans=ans+1
    print(ans)
  except:
    break

Python: while(True):
    try:
        ans = 0
        n = input()
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for l in range(10):
                        if(i + j + k + l == n):
                            ans += 1
        print(ans)
    except Exception:
        break

Python: import sys

for num in sys.stdin:
    num = int(num)
    counter = 0
    for i in range(0,10):
        for j in range(0,10):
            for k in range(0,10):
                for l in range(0,10):
                    if (i+j+k+l) == num:
                        counter += 1
    print(counter)

Python: x=[0]*51
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				x[a+b+c+d]+=1
while True:
	try:
		print(x[int(input())])
	except:
		break

Python: # -*- coding: utf-8 -*-
while True:
    try:
        n = int(raw_input())
        case = 0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a + b + c + d == n:
                            case += 1
        print(case)
    except EOFError:
        break

Python: def calc(n, x):
    # n個の数(0~9)の和でxが作れるかどうかを判別する
    if n == 1:
        if x <= 9:
            return 1
        else:
            return 0
    else:
        num = 0
        for i in range(10):
            if x-i < 0:
                continue
            num += calc(n-1, x-i)
        return num


while True:
    try:
        print(calc(4, int(input())))
    except:
        exit(0)

Python: import sys
a=[0]*51;x=range(10)
for i in range(51):
 a[i]=sum([1 for a in x for b in x for c in x for d in x if a+b+c+d==i])
for e in sys.stdin:
 print(a[int(e)])

Python: import sys
values = []
for line in sys.stdin:
    values.append(int(line))
ans = [1 for i in range(10) for j in range(10) for k in range(10) for l in range(10) if n == i + j + k + l]
print(ans.count(1))

Python: from collections import deque
import sys

def solve(n, target):
    """ 0-9?????§?????°???n???????¶?????????¨??§???target??????????????????????????? """
    if n <= 1:
        if 0 <= target <=9:
            Q.append(target)
            return target
        else:
            return None
    else:
        for i in range(10):
            res = solve(n - 1, target - i)


Q = deque()
if __name__ == '__main__':
    # ??????????????\???
    for line in sys.stdin:
        target = int(line)

        result = solve(4, target)
        print(len(Q))
        Q.clear()

Python: import sys
from itertools import product
s = [sum(l) for l in product(range(10), repeat = 4)]

ns = sys.stdin.readlines()
for n in ns:
    print(s.count(int(n)))

Python: while True:
    try:
        n = int(input())
    except EOFError:
        break
    answer = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a+b+c+d == n:
                        answer += 1
    print(answer)