[恢]hdu 2368

2011-12-20 15:48:40

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

题意:一个矩形的长宽分别为w、l的PIZZA是否能完全放在一个半径为r的桌子上。

代码:

# include <stdio.h>


int main ()
{
int nCase = 1, l, w, r ;
while (~scanf ("%d", &r) && r)
{
scanf ("%d%d", &w, &l) ;
if (w*w+l*l<=4*r*r)
printf ("Pizza %d fits on the table.\n", nCase++) ;
else
printf ("Pizza %d does not fit on the table.\n", nCase++) ;

}
return 0 ;
}



posted @ 2012-01-06 23:14  Seraph2012  阅读(131)  评论(0编辑  收藏  举报