Jason的第一个程序

# -*- coding: utf-8 -*-
from __future__ import division</code>
import math # This will import math module

x = float(raw_input (“请输勾值: “))
i = 0
for y in range (1, 1000000) :
a = int(x)
b = y
c = math.sqrt(x**2+y**2)
d = c-int(c)
if ( d == 0 ) :
i += 1
print “勾:”, a
print “股:”, b
print “弦:”, int(c)
print “勾股定理:”, a,”^2+”,b,”^2=”,int(c),”^2″
if (i == 0 ):
print “没有整数勾股组合”
elif(i &gt; 0):
print “有”,i,”个整数勾股组合”