int r,h这些变量的类型,都改成float
float r,h,p,c,s1,s2,v1,v2;
因为你定义的变量都为int,可以尝试换成float
你定义了int,赋值却是float,统一一下数据类型。