1 C语言编程求圆球体积如下:#include <stdio.h>#define pi 3.1415926int main(){double r;printf("请输入球体的半径:");scanf("%lf",&r);printf("球体的表面积为:%.2lf\n",4*pi*r*r);printf("球体的体积为:%.2lf\n",4.0/3*pi*r*r*r);return 0;扩展资料:求圆周长、圆面积、圆球表面...
scanf("%lf", &r);//这里有变动,双精度浮点型(double)输入是用%lf动 ,%.2lf c = PI * 2.0 * r;s1 = PI * r * r;s2 = 4.0 * s1;v = (4 * PI * r * r * r)/3.0;printf("周长 = %.2lf\n圆面积 = %.2lf\n球面积 = %.2lf\n球体积 = %.2lf\n", ...