错误代码:
#include<stdio.h>
#include<math.h>
int main()
{
const double PI = 3.14159;
double r, volume, surface_area;
printf("Please input the radius of the ball: ");
scanf("%lf", &r);
volume = 4PIpow(r,3)/3;
surface_area = 4PIpow(r,2);
printf("volume=%lf, surface_area=%lf", volume, surface_area);
}

改正后的:
#include<stdio.h>
#include<math.h>
int main()
{
const double PI = 3.14159;
double r, volume, surface_area;
printf("Please input the radius of the ball: ");
scanf("%lf", &r);
volume = 4/3PIpow(r,3);
surface_area = 4PIpow(r,2);
printf("volume=%lf, surface_area=%lf", volume, surface_area);
}

我不理解啊啊!!为什么,求体积的公式/3要放到4后面才对?而且,就算这个体积公式不对,为什么输出会等于面积啊?