【HDU 2134】【水题】Cuts the cake

来源:互联网 发布:淘宝店铺如何排名靠前 编辑:程序博客网 时间:2024/05/29 08:40

 求面积面积相等的切圆的半径。

#include <stdio.h>#include <math.h># define pi 3.1415926int main(){    double r,r1,r2,s;    while(~scanf("%lf",&r)&&r)    {        s = pi*r*r;        r1 = sqrt(s/3.0/pi);        r2 = sqrt(2.0/3.0*s/pi);        printf("%.3lf %.3lf\n",r1,r2);    }    return 0;}//题意就只把蛋糕切成面积相等的三等分,求里面两个的半径,果断水题


0 0
原创粉丝点击