为什么float就不可以?
#include<stdio.h>
int main()
{
const double PI = 3.14;
double r, h, C1, Sa, Sb, Va, Vb;
scanf("%lf %lf", &r,&h);
C1 = 2 * PI * r;
Sa = PI * r * r;
Sb = 4 * PI * r * r;
Va = (4 * PI * r * r * r) / 3;
Vb = Sa * h;
printf("C1=%.2f\nSa=%.2f\nSb=%.2f\nVa=%.2f\nVb=%.2f", C1, Sa, Sb, Va, Vb);
return 0;
}
#include<stdio.h>
int main()
{
const float PI = 3.14;
float r, h, C1, Sa, Sb, Va, Vb;
scanf("%f %f", &r,&h);
C1 = 2 * PI * r;
Sa = PI * r * r;
Sb = 4 * PI * r * r;
Va = (4 * PI * r * r * r) / 3;
Vb = Sa * h;
printf("C1=%.2f\nSa=%.2f\nSb=%.2f\nVa=%.2f\nVb=%.2f", C1, Sa, Sb, Va, Vb);
return 0;
}
"=600 #left"