Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		if inputCount == 50 {
			break
		}
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
		count = 0
	}
	for _, v := range resultArr {
		fmt.Printf("%d\n", v)
	}
}

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: try:
    while True:
        #標準入力
        num = int(input())
        kei = 0
        #全パターン試す
        for num1 in range(0,10):
            for num2 in range(0,10):
                for num3 in range(0,10):
                    for num4 in range(0,10):
                        #合計が入力値と同じならカウントを増やす
                        if num1 + num2 + num3 + num4 == num:kei += 1
                        else:pass
        #出力
        print(kei)
#EOFErrorをひろう
except EOFError:
    pass

Python: while True:
	try:
		n = eval(input())
		if n > 36:
			print(0)
		else:
			count = 0
			for a in range(0, 10):
				for b in range(0, 10):
					for c in range(0, 10):
						for d in range(0, 10):
							if a + b + c + d == n:
								count += 1
			print(count)
	except EOFError:
		break

Python: import sys
import math

def case(a,b):
	return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))

while True:
	try:
		n = int(input())
		if n >= 37:
			print('0')
		elif n >= 10 and n <= 18:
			print(int(case(n,3)-3*case(n-9,2)))
		elif n >= 19 and n <= 27:
			print(int(case(n,3)-3*case(n-9,2)-3*case(n-18,1)))
		elif n >= 28 and n <= 36:
			print(int(case(36-n,3)))
		else:
			print(int(case(n,3)))	
	except EOFError:
		break

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

Python: while True:
    try:
        n=int(input())
    except:
        break
    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==n:
                        s+=1
    print(s)

Python: import sys; print("\n".join(str(sum(1 for n in [int(in_n)] for a in range(10) for b in range(a, a+10) for c in range(b, b+10) for d in range(c, c+10) if d == n)) for in_n in sys.stdin))

Python: import sys
import math

def case(a,b):
	return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))

while True:
	try:
		n = int(input())
		if n >= 37:
			print('0')
		elif n >= 10 and n <= 18:
			print(int(case(n,3)-3*case(n-9,3)))
		elif n >= 19 and n <= 27:
			print(int(case(36-n,3)-3*case(36-n-9,3)))
		elif n >= 28 and n <= 36:
			print(int(case(36-n,3)))
		else:
			print(int(case(n,3)))	
	except EOFError:
		break

Python: import sys
import math
for n in sys.stdin:
    n = int(n)
    nn = n
    arr = []
    for i in range (1,5):
        if(nn>10):
            arr.append(9)
            nn = nn-9
        else:
            arr.append(nn)
            nn = nn-nn

    #print(arr)

    top = math.factorial(4)
    bottom = 1
    for i in range(0,4):
        exist = False
        for j in range(0,i):
            if(arr[i]==arr[j]):
                exist = True
        count = 0
        if(not(exist)):
            for j in arr:
                if(arr[i]==j):
                    count += 1

            bottom = bottom * math.factorial(count)


    print(str(int(top/bottom)))

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

Python: while True:
    try:
        s=int(input())
        i=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==s:
                            i+=1

        print(i)
    except:
        break

Python: while 1:
    try:
        n=int(input())
        i=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:i+=1
        print(i)
    except:break

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: import sys
import math

def case(a,b):
	return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))

while True:
	try:
		n = int(input())
		if n >= 37:
			print('0')
		elif n >= 10 and n <= 36:
			print(case(n,4)-case(n-10,3))
		else:
			print(case(n,4))		
	except EOFError:
		break

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def kai(num): 
	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
def main():
	while True:
		try:
			num = int(input())
		except:
			return
		else:
			print(kai(num))
		
if __name__ == '__main__':
	main()

Python: import sys
import math as mas

x=[0]*60
for i in range(10):
	for j in range(10):
		for k in range(10):
			for l in range(10):
				x[i+j+k+l]+=1
for i in sys.stdin:
	print(x[int(i)])

#	a,b=map(int,i.split())
#	print(gcd(a,b),lcm(a,b))

Python: import sys
for n in sys.stdin:
	print(len([0 for a in range(10)for b in range(10)for c in range(10)for d in range(10) if int(n)==a+b+c+d]))

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

def main():
    for line in sys.stdin:
        n = int(line)
        cnt = 0
        for a in range(0,10):
            for b in range(0,10):
                for c in range(0,10):
                    for d in range(0,10):
                        if a+b+c+d==n: cnt += 1
        print(cnt)


if __name__ == "__main__": main()

Python: import sys

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

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

Python: for line in open(0).readlines():
    N = int(line)
    lim = min(9, N)
    ans = 0
    if 0 <= N <= 36:
        for a in range(0, lim+1):
            for b in range(0, lim+1):
                for c in range(0, lim+1):
                    d = N - a - b - c
                    if 0 <= d <= lim:
                        ans += 1
    print(ans)

Python: while(True):
    a = 0
    n = int(input())

    if n > 36:
        print(0)
        continue
    elif n==36:
        print(1)
        continue
    b = n
    for i in range(10):
        if n-i==0:
            a=a+1
            #print("(%d,0,0,0)"%(i))
            break
        for j in range(10):
            if n-i-j==0:
                a=a+1
                #print("(%d,%d,0,0)"%(i,j))
                break
            for k in range(10):
                b = n-i-j-k
                if b>=0 and b<=9:
                    a=a+1
                    #print("(%d,%d,%d,%d)"%(i,j,k,b))
                    continue
                elif b > 9:
                    continue
                else:
                    break
                    
    
    print(a)
return 0