![]() |
#2
风吹过b2013-03-19 08:33
|
编写程序,求出一百以内的所有勾股数。
for a = 1 to 100
for b = a to 100
c = sqr( a * a + b * b )
if c = fix( c ) and c <= 100 then print a,b,c
next b
next a
这样是否可以?