python基礎(計算三角形的面積和周長)

import math a=int(input(「請輸入第一條邊」)) b=int(input(「請輸入第二條邊」)) c=int(input(「請輸入第三條邊」)) p=(a+b+c)/2 g=math.sqrt(p*(p-a)(p-b)(p-c)) if a+b>c and b+c>a and c+a>b: print(「三角形的周長:」+str(a+b+c)) print(「三角形的面積:」
相關文章
相關標籤/搜索