题解 | #球的体积与表面积#
球的体积与表面积
http://www.nowcoder.com/practice/5d315b9f93df4935b8d216c14e6db4be
import math
def ball_v(r):
return r**3*math.pi*4/3
def ball_s(r):
return r**2*math.pi*4
input_list = input()
input_list = input_list.split(" ")
for i in input_list:
#print("%.3f %.3f",%(ball_v(int(i)) , %ball_s(int(i))))
print("%.3f %.3f"%(ball_v(int(i)),ball_s(int(i))))
def ball_v(r):
return r**3*math.pi*4/3
def ball_s(r):
return r**2*math.pi*4
input_list = input()
input_list = input_list.split(" ")
for i in input_list:
#print("%.3f %.3f",%(ball_v(int(i)) , %ball_s(int(i))))
print("%.3f %.3f"%(ball_v(int(i)),ball_s(int(i))))