#include <stdio.h>
int main()
{
int kase=0;
double r, w, l;
while(~scanf("%lf", &r) && r)
{
scanf("%lf%lf", &w, &l);
w /= 2;
l /= 2;
if(w * w + l * l <= r * r) printf("Pizza %d fits on the table.\n",++kase);
else printf("Pizza %d does not fit on the table.\n",++kase);
}
return 0;
int main()
{
int kase=0;
double r, w, l;
while(~scanf("%lf", &r) && r)
{
scanf("%lf%lf", &w, &l);
w /= 2;
l /= 2;
if(w * w + l * l <= r * r) printf("Pizza %d fits on the table.\n",++kase);
else printf("Pizza %d does not fit on the table.\n",++kase);
}
return 0;
}
心得:水题,本来看错题目想想还是做了吧。int型数比较大小时变成double,注意下