view problem9.py @ 14:49c96972949d default tip

#50 rewrite of solution
author Dominic Cleal <dominic@computerkb.co.uk>
date Mon, 01 Dec 2008 19:11:55 +0000
parents 1ca695e32f66
children
line wrap: on
line source

for a in range(1, 1000):
	for b in range(a + 1, 1000):
		if a + b > 1000:
			break
		for c in range(b + 1, 1000):
			if a + b + c == 1000 and a*a + b*b == c*c:
				print "%d^2 %d^2 = %d^2" % (a, b, c)
				print "a*b*c = %d" % (a*b*c)