题解 | 绕距
绕距
https://www.nowcoder.com/practice/7a245fc6284f4139b4fb21de58e68483
#include <stdio.h>
#include <math.h>
int main() {
int x1, x2, y1, y2;
double de, dm;
scanf("%d %d", &x1, &y1);
scanf("%d %d", &x2, &y2);
de = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
dm = fabs(x1 - x2) + fabs(y1 - y2);
double det = fabs(dm * 1.0 - de);
printf("%lf", det);
return 0;
}
腾讯音乐娱乐集团公司福利 285人发布