10 条题解
-
2
#include <iostream> #include <stdio.h> #include <iomanip> #include <math.h> using namespace std; const int N = 1e6 + 10; const int INF = 0x3f3f3f3f; int main() { float x1 , x2 , y1 , y2; cin >> x1 >> y1 >> x2 >> y2; x1 = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ); x1 = sqrt( x1 ); cout << fixed << setprecision(3) << x1; }
-
1
/******************************* *******************************/ #include <stdio.h> #include <iostream> #include <math.h> using namespace std; int main() { double x1, x2, y1, y2; cin >> x1 >> y1 >> x2 >> y2; double a, b; a = x1 - x2; b = y1 - y2; double c; c = a * a + b * b; c = sqrt(c); printf("%.3lf\n",c); }
- 1
信息
- ID
- 823
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 530
- 已通过
- 230
- 上传者