计算球体积

http://acm.hdu.edu.cn/showproblem.php?pid=2002

   1 #include <stdio.h>
   2 
   3 int main() {
   4     double r;
   5     while(scanf("%lf", &r) != EOF)
   6         printf("%.3f\n", 4.0/3.0*3.1415927*r*r*r);
   7 }

注:此题有bug,PI不能取得太精确,否则会WA。

hdu2002 (2008-06-01 15:41:35由czk编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.