HDU 2368 Alfredo's Pizza Restaurant

 

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

初中数学题,圆幂定理

View Code
#include <iostream>

using namespace std ;

int main()

{

    double r,w,l;

    int nCase=1;

    while(scanf("%lf",&r),r)

    {

        scanf("%lf%lf",&w,&l);

        if(r*r-(w/2)*(w/2)<(l/2)*(l/2))

            printf("Pizza %d does not fit on the table.\n",nCase++);

        else

            printf("Pizza %d fits on the table.\n",nCase++);

    }

    return 0;

}

 

你可能感兴趣的:(REST)