输入一个表示半径的浮点数,计算圆的面积的程序正确的有:(圆周率取3.14,结果保留2位小数)
A: radius = float(input())area = 3.14 * radius ** 2print(round(area, 2))
B: radius = float(input())area = 3.14 * radius * radiusprint(round(area, 2))
C: radius = input()print(round(3.14 * radius ** 2, 2))
D: radius = float(input())print(round(3.14 * radius * radius, 2))
A: radius = float(input())area = 3.14 * radius ** 2print(round(area, 2))
B: radius = float(input())area = 3.14 * radius * radiusprint(round(area, 2))
C: radius = input()print(round(3.14 * radius ** 2, 2))
D: radius = float(input())print(round(3.14 * radius * radius, 2))
举一反三
- 输入一个表示半径的浮点数,计算圆的面积的程序正确的有:[br][/br] (圆周率取使用math库中的pi值,结果保留2位小数) A: import math <br> radius = float(input()) area = math.pi * radius ** 2 print(round(area, 2)) B: import math <br> radius = float(input()) area = pi * radius ** 2 print(round(area, 2)) C: from math import pi <br> radius = float(input()) area = math.pi * radius ** 2 print(round(area, 2)) D: from math import pi <br> radius = float(input()) area = pi * radius ** 2 print(round(area, 2))
- 编写程序,从键盘输入圆的半径,计算并输出圆的面积。以下代码有一个错误,是哪句? import math radius=float(input("请输入圆的半径:")) circumference=2*pi*radius area=pi*radius*radius print("圆的周长为:%.2f" % circumference) print("圆的面积为:%.2f" % area) A: import math B: adius=float(input("请输入圆的半径:")) C: area=pi*radius*radius D: print("圆的面积为:%.2f" % area)
- 如果有以下关于变量赋值的程序代码: float radius = 88.2; double area= 3.14 * radius * radius; System.out.println(area);
- The slenderness ratio is the ratio of ( ) A: area of column to least radius of gyration B: length of column to least radius of gyration C: least radius of gyration to area of column D: least radius of gyration to length of column
- 【简答题】微实例 1.1 圆面积的计算 输入:从控制台输入圆半径 raduis 处理:计算圆面积 area = π * radius * radius (此处,π取 3.1415 ) 输出:圆面积 area