[2001]:计算两点间的距离(简单的题目)
来源:互联网 发布:索尼如何用网络看电视 编辑:程序博客网 时间:2024/06/09 21:05
计算两点间的距离
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 147499 Accepted Submission(s): 52691
Problem Description
输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。
Input
输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。
Output
对于每组输入数据,输出一行,结果保留两位小数。
Sample Input
0 0 0 1
0 1 1 0
Sample Output
1.00
1.41
#include<stdio.h>#include<math.h>int main(){ double x1, x2, y1, y2; char i, j, k; while(scanf("%lf%c%lf%c%lf%c%lf", &x1, &i, &y1, &j, &x2, &k, &y2)!=EOF){ double distance = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)); printf("%.2f\n", distance); getchar(); } return 0;}
这是一道对两点距离公式简单运用的题目
0 0
- [2001]:计算两点间的距离(简单的题目)
- 计算两点间的距离(2001)
- 2001 计算两点间的距离
- hdu 2001 计算两点间的距离
- HDU 2001 计算两点间的距离
- 2001 计算两点间的距离
- 2001 计算两点间的距离
- HDU 2001 计算两点间的距离
- HDU 2001 计算两点间的距离
- HDU 2001 - 计算两点间的距离
- ACM-2001-计算两点间的距离
- 计算两点间的距离(2001)
- HDU 2001 计算两点间的距离
- [hdu 2001] 计算两点间的距离
- 2001 计算两点间的距离
- HDOJ 2001 计算两点间的距离
- HDOJ 2001 计算两点间的距离
- HDU 2001 计算两点间的距离
- IT公司面试手册提供最全的软件测试类面试题
- Mysql数据库 hibernate保存数据时,Mysql主键需设定自增,否则报错!(Field 'id' doesn't have a default value)
- 前端优化带来的思考,浅谈前端工程化
- win2012的VMQ好像是鸡肋
- bzoj2067: [Poi2004]SZN
- [2001]:计算两点间的距离(简单的题目)
- Android M新控件之FloatingActionButton,TextInputLayout,Snackbar,TabLayout的使用
- java中的Collection集合 List Set Map
- 几种常用的webservice客户端和spring集成的方法
- nginx+ffmpeg筹建rtmp转播rtsp流的flash服务器
- 寻找ios培训机构
- Linux根目录下的sys文件夹下的子目录
- iOS常用方法
- nib must contain exactly one top level object which must be a UITableViewCell instance