HDU 2368 Alfredo's Pizza Restaurant

圆桌上能否放下方块披萨

都用平方!

 1 #include <iostream>
 2 #include <stdio.h>
 3 #include <string.h>
 4 #define READ() freopen("in.txt", "r", stdin);
 5 
 6 using namespace std;
 7 
 8 typedef long long LL;
 9 
10 int main()
11 {
12     LL len, width;
13     LL rad;
14     int cnt = 1;
15     while (~scanf("%lld%lld%lld", &rad, &len, &width))
16     {
17         if (rad == 0) break;
18         rad *= 2;
19         rad *= rad;
20         LL cor = len*len + width*width;
21         if (cor <= rad) printf("Pizza %d fits on the table.\n", cnt++);
22         else printf("Pizza %d does not fit on the table.\n", cnt++);
23     }
24     return 0;
25 }

 

posted @ 2017-03-18 11:14  Lorazepam  阅读(149)  评论(0编辑  收藏  举报