为什么这道题我在本地调试可以通过,为什么复制到答题环境就是0ac?
代码如下,各位能帮我看看哪里有问题吗
#include<iostream> #include <sstream> #include<string> #include<vector> using namespace std; int main(){ int radius, x_center, y_center, x1, y1, x2, y2; while(cin >> radius >> x_center >> y_center >> x1 >> y1 >> x2 >> y2){ int x, y; bool count = false; if(x_center > x2) x = x2; else if(x_center < x1) x = x1; else x = x_center; if(y_center > y2) y = y2; else if(y_center < y1) y = y1; else y = y_center; int dist = (x - x_center) * (x - x_center) + (y - y_center) * (y -y_center); if(dist <= radius * radius) count = true; cout <<boolalpha << count <<endl; } }
全部评论
(4) 回帖