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.
", cnt++);
22         else printf("Pizza %d does not fit on the table.
", cnt++);
23     }
24     return 0;
25 }
原文地址:https://www.cnblogs.com/oscar-cnblogs/p/6572313.html