Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- double pi=2*acos(0.00);
- double d,v,a_cylinder,a_conics,dif,ans;
- while(scanf("%lf%lf",&d,&v)==2)
- {
- if(d==0&&v==0)
- break;
- a_cylinder=pi*(pow(d/2.00,2))*d;
- a_conics=2*pi*(1.0/3.0)*(pow(d/2.00,3));
- dif=(a_cylinder-a_conics)-v;
- ans=cbrt((6.0*dif)/pi);
- printf("%.3lf\n",ans);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement