题目:http://acm.hdu.edu.cn/showproblem.php?pid=2547
AC代码(C++):
#include <iostream> #include <queue> #include <string> #include <algorithm> #include <math.h> #define INF 0x3f3f3f3f #define eps 1e-8 using namespace std; int main() { int t; cin >> t; while (t--) { double a, b, c, d; cin >> a >> b >> c >> d; double ans = sqrt((a - c)*(a - c) + (b - d)*(b - d)); printf("%.1lf\n", ans); } //system("pause"); }总结: 水题. 求两个圆相交时最短的半径之和, 其实就是求两点间距离.