Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

Python: import sys
t = [None 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: n = int(input())

def rec(j,s):
    if s > n:
        return 0
    if s == n:
        return 1
    if j == 0:
        return 0
    v = 0
    for i in range(10):
        v += rec(j-1, s + i)
    return v

print(rec(4,0))

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

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]
for e in sys.stdin:
 print(a[int(e)])

Python: while True :
    try :
        n = int(input())
        
    except :
        break
    
    S = [(0, 0, 0, 0) for i in range(10000)]
    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[s] = (a, b, c, d)
                        s += 1
                    else :
                        pass
        
    S = set(S)
        
    print(len(S) - 1)

Python: import sys

for line in sys.stdin:
    num = int(line)
    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
    print(ans)

Python: import sys
import math

for line in sys.stdin:
    N = int(line.rstrip())
    count = 0
    for i0 in range(10):
        for i1 in range(10):
           for i2 in range(10):
              for i3 in range(10):
                  if sum([i0,i1,i2,i3]) == N:
                      count += 1
                      break
    print(count)

Python: while True:
    try:
        n = int(input())
        if n > 18:
            n = 36 - n

        ans = (n+1)*(n+2)*(n+3)/6
        if n >= 10:
            n = n - 10
            ans = ans - 2*(n+1)*(n+2)*(n+3)/3
        
        if n < 0:
            ans = 0

        print(int(ans))

    except EOFError:
        break

Python: import sys

p = [0] * 51
v = 0
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: a = int(input())
count = 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) is a:
                    count += 1
print(count)

Python: # -*- coding: utf-8 -*-

import sys

def sum_intergers(n, k=4, last=True):
    clip_9 = lambda x: x if x < 10 else 9

    if k > 1:
        c = sum_intergers(n, k=k-1, last=False)
    else:
        return [(s,) for s in range(clip_9(n)+1)]

    ret = []
    for cc in c:
        sum_cc = sum(cc) # memorize
        for s in range(clip_9(n-sum_cc)+1):
            if not last or s+sum_cc==n:
                r = [p for p in cc]
                r.append(s)
                ret.append(tuple(r))
    return ret


def main():
    ns = [int(n) for n in sys.stdin]
    for n in ns:
        c = len(sum_intergers(n, k=4))
        print(c)


if __name__ == '__main__':
    main()

Python: from itertools import product

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

    count = sum(a+b+c+d == n for a, b, c, d in product(range(10), repeat=4))
    print(count)

Python: def count(n):
    cnt = 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:
                        cnt += 1
    print(cnt)

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

Python: import sys
def count(number) :
    Ranges = [(a, b, c, d) 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 == number]
    return len(Ranges)

for make in sys.stdin : print(count(int(make)))

Python: # Aizu Problem 0008: Sum of 4 Integers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def sum4(n):
    ans = 0
    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:
                        ans += 1
    return ans


mem = {}
for line in sys.stdin:
    n = int(line)
    if n in mem:
        print(mem[n])
    else:
        ans = sum4(n)
        mem[n] = ans
        print(ans)

Python: while True:
    try:
        n = int(input())
    except:
        break
    x = 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):
                    x += (a + b + c + d == n)
    print(x)

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: import sys
for n in sys.stdin:
    num = 0
    n = int(n.replace("\n",""))
    for i in range(0, 10000):
        s = sum([i%10, int(i/10)%10, int(i/100)%10, int(i/1000)])
        if n == s:
            num += 1
    print(num)

Python: import sys
for line in sys.stdin.readlines():
  n = int(line)
  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)

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