• 2022-07-28
    输入一个表示半径的浮点数,计算圆的面积的程序正确的有:[br][/br] (圆周率取使用math库中的pi值,结果保留2位小数)
    A: import math
    radius = float(input()) area = math.pi * radius ** 2 print(round(area, 2))
    B: import math
    radius = float(input()) area = pi * radius ** 2 print(round(area, 2))
    C: from math import pi
    radius = float(input()) area = math.pi * radius ** 2 print(round(area, 2))
    D: from math import pi
    radius = float(input()) area = pi * radius ** 2 print(round(area, 2))