位址
http://acm.hdu.edu.cn/showproblem.php?pid=2001
定位
- 數學題
- 水題
分析
- (x2−x1)2+(y2−y1)2−−−−−−−−−−−−−−−−−−√
代碼
[cpp]view plain copy print ?
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- int main() {
- double x1,y1,x2,y2;
- while(scanf(“%lf %lf %lf %lf”,&x1,&y1,&x2,&y2)!=EOF) {
- double tmp=pow(x2-x1,2)+pow(y2-y1,2);
- tmp=sqrt(tmp);
- printf(”%.2lf\n”,tmp);
- }
- return 0;
- }
性能
Exe.Time | Exe.Memory | Code Length | Language |
---|---|---|---|
15MS | 1880K | 334B | c++ |