甘銀鑫08
提問人:qq20211015093256發(fā)布時(shí)間:2021-10-19
num = int(input("請(qǐng)輸入一個(gè)三位數(shù):"))
# print('%s*10^2+%s*10+%s' % (num[0], num[1], num[2]))
gw = num%10
sw = (num/10)%10
bw = num/100
total = gw*gw*gw + sw*sw*sw + bw*bw*bw
if( total == num):
print("是水仙花數(shù)")
else:
print("不是水仙花數(shù)")
# 三角形面積
import math
a = float(input("請(qǐng)輸入第一條邊的長(zhǎng)度,"))
b = float(input("請(qǐng)輸入第二條邊的長(zhǎng)度,"))
c = float(input("請(qǐng)輸入第三條邊的長(zhǎng)度,"))
p = (a+b+c)/2
S = math.sqrt(p*(p-a)*(p-b)*(p-c))
print(S)
# print('%s*10^2+%s*10+%s' % (num[0], num[1], num[2]))
gw = num%10
sw = (num/10)%10
bw = num/100
total = gw*gw*gw + sw*sw*sw + bw*bw*bw
if( total == num):
print("是水仙花數(shù)")
else:
print("不是水仙花數(shù)")
# 三角形面積
import math
a = float(input("請(qǐng)輸入第一條邊的長(zhǎng)度,"))
b = float(input("請(qǐng)輸入第二條邊的長(zhǎng)度,"))
c = float(input("請(qǐng)輸入第三條邊的長(zhǎng)度,"))
p = (a+b+c)/2
S = math.sqrt(p*(p-a)*(p-b)*(p-c))
print(S)
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
點(diǎn)擊加載更多評(píng)論>>