HDOJ 2001 计算两点间的距离
来源:互联网 发布:ppt数据分析图表对比 编辑:程序博客网 时间:2024/05/17 03:23
计算两点间的距离
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 94488 Accepted Submission(s): 36264
Problem Description
输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。
Input
输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。
Output
对于每组输入数据,输出一行,结果保留两位小数。
Sample Input
0 0 0 10 1 1 0
Sample Output
1.001.41
Author
lcy
第一次代码:
#include <stdio.h>#include <math.h>int main (){ double x1,x2,y1,y2,d; while (scanf("%lf%lf%lf%lf",&x1,&x2,&y1,&y2)!=EOF) { d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); printf ("%.2lf\n",d); } return 0;}
Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.LanguageAuthor111057402014-07-20 17:49:31Wrong Answer20010MS240K251 BC++Hidden Secret
第二次代码:
#include <stdio.h>#include <math.h>int main (){ double x1,x2,y1,y2; while (scanf("%lf%lf%lf%lf",&x1,&x2,&y1,&y2)!=EOF) { printf ("%.2lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))); } return 0;}
Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.LanguageAuthor111057902014-07-20 17:55:37Wrong Answer200115MS240K235 BC++Hidden Secret
第三次代码:
#include <cstdio>#include <cmath>int main(){ double x1, y1, x2, y2; while(scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2) != EOF) printf("%.2lf\n", sqrt((double)((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)))); return 0;}
Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.LanguageAuthor111058182014-07-20 17:59:19Accepted20010MS240K239 BC++Hidden Secret
第四次代码:
#include <cstdio>#include <cmath>int main(){ double x1, y1, x2, y2; while(scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2) != EOF) printf("%.2lf\n", sqrt((double)((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)))); return 0;}
Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.LanguageAuthor111058282014-07-20 18:00:28Accepted20010MS240K236 BC++Hidden Secret
第五次代码:
#include <stdio.h>#include <math.h>int main (){ double x1,x2,y1,y2,d; while (scanf("%lf%lf%lf%lf",&x1,&x2,&y1,&y2)!=EOF) { d=(double)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); printf ("%.2lf\n",d); } return 0;}
Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.LanguageAuthor111058722014-07-20 18:05:16Wrong Answer200115MS240K259 BC++Hidden Secret
表示此题始终不知道自己错在哪里
0 0
- HDOJ 2001 计算两点间的距离
- HDOJ 2001 计算两点间的距离
- HDOJ-2001-计算两点间的距离
- HDOJ 2001 计算两点间的距离
- HDOJ 2001计算两点间的距离
- HDOJ 2001-计算两点间的距离
- HDOJ 2001 计算两点间的距离
- Hdoj 2001 计算两点间的距离
- HDOJ 2001 计算两点间的距离
- HDOJ 【C】2001 计算两点间的距离
- hdoj.2001 计算两点间的距离 20140721
- HDOJ 2001 计算两点间的距离(水题)
- HDOJ--2001 计算两点间的距离 + HDOJ--2002 计算球体积
- 2001 计算两点间的距离
- hdu 2001 计算两点间的距离
- HDU 2001 计算两点间的距离
- 2001 计算两点间的距离
- 2001 计算两点间的距离
- 如何下载dlx
- HDU 1003 MAX SUM java 实现
- Framework概述(一)
- Windows访问VMware Workstation中通过NAT联网的虚拟机
- 不小心删除了myeclipse下新建项目里面的J2EE 5 libraries 和 JRE System Library怎么恢复回去啊,急!
- HDOJ 2001 计算两点间的距离
- Unix/Linux环境C编程入门教程(27) 内存那些事儿
- 我的第一博客
- Windows与Linux(Ubuntu)双系统时间不一致的解决方法
- jquery 获得星期几
- 220Othello
- Linux使用locate命令定位文件
- iOS平台的应用程序调试与分析
- 史上最经典的IT入门学习教程DVD光盘免费领!