python求圆的面积和周长

import math #调用math函数r = float(input("输入圆的半径:"))S = math.pi*float(r)**2C = 2*math.pi*float(r)print("半径为{0}的圆的面积为:{1}".format(r, round(S,2)))print("半径为{0}的圆的周长为:{1}".format(r, round(C,2)))希望可以帮到你 ...
python求圆的面积和周长
import math #调用math函数r = float(input("输入圆的半径:"))S = math.pi*float(r)**2C = 2*math.pi*float(r)print("半径为{0}的圆的面积为:{1}".format(r, round(S,2)))print("半径为{0}的圆的周长为:{1}".format(r, round(C,2)))希望可以帮到你
2021-05-12
mengvlog 阅读 54 次 更新于 2025-12-16 12:06:03 我来答关注问题0
檬味博客在线解答立即免费咨询

Python相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部