Advertisement
noshin98

uva 10297

Jul 12th, 2016
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. int main()
  5. {
  6.     double pi=2*acos(0.00);
  7.     double d,v,a_cylinder,a_conics,dif,ans;
  8.     while(scanf("%lf%lf",&d,&v)==2)
  9.     {
  10.         if(d==0&&v==0)
  11.             break;
  12.         a_cylinder=pi*(pow(d/2.00,2))*d;
  13.         a_conics=2*pi*(1.0/3.0)*(pow(d/2.00,3));
  14.         dif=(a_cylinder-a_conics)-v;
  15.         ans=cbrt((6.0*dif)/pi);
  16.  
  17.         printf("%.3lf\n",ans);
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement