Go: package main

import (
  "fmt"
)

func main() {
  var a int
  var b int
  for _, err := fmt.Scan(&a); err == nil; _, err = fmt.Scan(&a) {
    b = 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) {
              b++
            }
          }
        }
      }
    }
  fmt.Println(b)
  }
}

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

Python: import sys
from itertools import product

sum = [0] * 51
for k,l in product([i+j for i,j in product(range(10),repeat=2)],repeat=2):
    sum[k+l] += 1

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

Python: while True:
    try:
        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):
                        if a + b + c + d == N:
                            count += 1
        print(count)
    except EOFError:
        break

Python: for _ in range(50):
    try:
        n = int(input()) # 1 <= n <= 50
        ans =set()
        for a in range(10):
            if (n - a) >= 1:
                for b in range(10):
                    if(n - a -b) >= 1:
                        for c in range(10):
                            if(n - a - b - c) >= 1:
                                for d in range(10):
                                    if(n - a - b - c - d) == 0:
                                        ans.add("{},{},{},{}".format(a,b,c,d))
        print(len(ans))
    except EOFError:
        break

Python: import math
n = int(input())
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)))
print()

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

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:
    n = int(line)
    print(t.count(n))