直接上代碼
1 import math 2 def hypotenuse(a,b): 3 return(math.sqrt(a**2+b**2)) 4 side1 = int(input("第一條直角邊:")) 5 side2 = int(input("第二條直角邊:")) 6 print("你要計算的直角三角形邊斜邊長度為:{}".format(int(hypotenuse(side1,side2))))
直接上代碼
1 import math 2 def hypotenuse(a,b): 3 return(math.sqrt(a**2+b**2)) 4 side1 = int(input("第一條直角邊:")) 5 side2 = int(input("第二條直角邊:")) 6 print("你要計算的直角三角形邊斜邊長度為:{}".format(int(hypotenuse(side1,side2))))
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。