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++
		}
	}
}

Python: import sys
import itertools

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

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

if __name__ == '__main__':
    main()

Python: import sys

def ans(num):
    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 == num:
                        ans += 1

    return ans


def main():
    a = []

    for line in sys.stdin:
        a.append(int(line))

    for line in a:
        print(ans(line))

if __name__ == "__main__":
    main()

Python: x=[0]*37
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: output = 0
try:
    while True:
        n = int(input())
        a = 0
        while a < 10 :
            b = 0
            while b < 10 :
                c = 0
                while c < 10 :
                    d = 0
                    while d < 10 :
                        if a + b + c + d == n :
                            output += 1
                        d += 1
                    c += 1
                b += 1
            a += 1
        print(output)
        output = 0
except EOFError:
    pass

Python: import itertools
def combination(n):
 c=0
 for i in itertools.product(range(10),repeat=4):
  (a,b,c,d)=i
  if a+b+c+d==n:
   c+=1
 return c

while True:
 try:
  n=int(input())
  combination(n)
 except EOFError:
  break

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

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

Python: import sys
from itertools import product

num = 4
l = [0] * (9*num + 1)
for x in map(sum, product(range(10), repeat=num)):
    l[x] += 1

for s in sys.stdin:
    print(l[int(s)])

Python: import sys
lines = sys.stdin.readlines()
for line in lines:
    inp = int(line)
    s = 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==inp:
                        s+=1
    print (s)

Python: import sys

p = [0] * 51
v = 0
for i in range(19):
    t = (i+3)*(i+2)*(i+1)//6
    v = v + 2 * (i-8) * (i-9) if i > 9 else 0
    p[i] = t - v
    p[36-i] = p[i]

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

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

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

Python: import sys
[print(sum([1 if sum([a, b, c, d]) == int(x) else 0 for a in range(10) for b in range(10) for c in range(10) for d in range(10)])) for x in sys.stdin]

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

Python: import sys
import itertools

def main():
    l = list(range(10))
    
    while True:
        data = sys.stdin.readline().strip()
        if data is None or data == '':
            break

        num = int(data)
        #print('num:', num)
        cnt = 0
        for elem in itertools.product(l, repeat=4):
            sum = 0
            for i in elem:
                sum += i

            if sum == num:
                cnt += 1

        print(cnt)

if __name__ == '__main__':
    main()

Python: import sys
c = [0 for i in range(37)]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                c[i+j+k+l] += 1
for line in sys.stdin:
    n = int(line)
    print(c[n])

Python: import sys

def getsum(n):
  if n > 36: return 0
  else:
    i = n if n < 19 else 36-n
    return (i+3)*(i+2)*(i+1)//6 - max(2*(i-9)*(i-8)*(i-7)//3,0)

for i in sys.stdin:
    print(getsum(int(i)))

Python: #! /usr/bin/python3

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

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

Python: n=int(input())
count=0
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				ans = a + b + c + d 
				if(n == ans):
					count += 1 
print(count)

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    n = int(N[l])
    ans = 0
    for a in range(min(n+1,10)):
        for b in range(min(n+1-a,10)):
            for c in range(min(n+1-a-b,10)):
                for d in range(min(n+1-a-b-c,10)):
                    if a+b+c+d == n:
                        #print(a,b,c,d)
                        ans = ans + 1
    print(ans)

Python: import sys

p = [0] * 51
for i in range(10):
    p[i] = p[36-i] = (i+3)*(i+2)*(i+1)//6

for i in range(10,19):
    p[i] = p[36-i] = (i+1)*(i+2)*(i+3)//6 - 2*(i-9)*(i-8)*(i-7)//3

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

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

Python: import itertools
while True:
    try:
        n = int(input())
        ans = 0
        for a in itertools.product(range(10), repeat=4):
            if n == sum(a):
                ans += 1
        print(ans)
    except:
        break

Python: num=int(input())
sum=0
Range=10
for a in range(Range):
    for b in range(Range):
        for c in range(Range):
            for d in range(Range):
                if num==a+b+c+d:
                    sum+=1
print(sum)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main(): 
	num = int(input())
	if num >= 19:
		num = 19 - num + 17
	res = 1
	gro1 = 3
	for i in range(8):
		if i == num:
			return res
		if i == 0:
			gro2 = 3
		else:
			gro2 += 1
		res += gro1
		gro1 += gro2
	
	for i in range(8,19):
		if i == num:
			return res
		gro2 -= 3
		res += gro1
		gro1 += gro2
			
		
if __name__ == '__main__':
	print(main())