#include "stdio.h" #define PI 3.1415927 int main(void){ double r; double v; while(scanf("%lf", &r) != EOF){ if(r < 0.000){ break; } v = (double)4/3 * PI * r * r * r; printf("%.3lf\n", v); v = 0.000; } return 0; }
时间: 2024-10-28 12:23:00
#include "stdio.h" #define PI 3.1415927 int main(void){ double r; double v; while(scanf("%lf", &r) != EOF){ if(r < 0.000){ break; } v = (double)4/3 * PI * r * r * r; printf("%.3lf\n", v); v = 0.000; } return 0; }