pku2610.cpp
来自「这是ACM 方面的资料 是PKU的 北京大学的出来的」· C++ 代码 · 共 21 行
CPP
21 行
#include "stdio.h"
int main()
{
double x0,y0,x1,y1,dis1,dis2;
double holex,holey;
int flag;
scanf("%lf%lf%lf%lf",&x0,&y0,&x1,&y1);
flag=0;
while(scanf("%lf%lf",&holex,&holey)!=-1)
{
dis1=(x0-holex)*(x0-holex)+(y0-holey)*(y0-holey);
dis2=(x1-holex)*(x1-holex)+(y1-holey)*(y1-holey);
if(dis1*4<dis2&&flag==0)
{
printf("The gopher can escape through the hole at (%.3f,%.3f).\n",holex,holey);
flag=1;
}
}
if(flag==0)printf("The gopher cannot escape.\n");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?