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 }
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步