位置:首页 > 软件操作教程 > 编程开发 > Python > 问题详情

甘银鑫08

提问人:qq20211015093256发布时间:2021-10-19
num = int(input("请输入一个三位数:"))
# 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("是水仙花数")
else:
  print("不是水仙花数")

# 三角形面积
import math
a = float(input("请输入第一条边的长度,"))
b = float(input("请输入第二条边的长度,"))
c = float(input("请输入第三条边的长度,"))
p = (a+b+c)/2
S = math.sqrt(p*(p-a)*(p-b)*(p-c))
print(S)

继续查找其他问题的答案?

相关视频回答
回复(0)
返回顶部