我写了一个程序。
print "Radius = "
radius = gets.chomp
print "Height = "
height = gets.chomp
ans = (2 * 3.14 * (radius * radius)) + (2 * 3.14 * radius * height)
它行不通。这是终端中的输出("11"
并且"10"
是我作为圆柱体的半径/高度输入的内容):
Radius = 11
Height = 10
in `*': can't convert String into Integer (TypeError)
请帮忙。