当前位置:网站首页>ZZULIOJ:1013: 求两点间距离
ZZULIOJ:1013: 求两点间距离
2022-08-10 03:39:00 【追上】
1013: 求两点间距离
时间限制: 1 Sec 内存限制: 30 MB
[状态] [讨论版] [提交] [命题人:admin]
题目描述
给定A(x1, y1), B(x2, y2)两点坐标,计算它们间的距离。
输入
输入包含四个实数x1, y1, x2, y2,分别用空格隔开,含义如描述。其中0≤x1,x2,y1,y2≤100。
输出
输出占一行,包含一个实数d,表示A, B两点间的距离。结果保留两位小数。
样例输入 Copy
1 1.5 2 2.5
样例输出 Copy
1.41
参考代码
#include <stdio.h>
int main()
{
double x1, y1, x2, y2, d;
scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
printf("%.2lf", d);
return 0;
}
边栏推荐
猜你喜欢
ARP Spoofing - Tutorial Details
[STL]map与set
program internationalization
测试工作管理与规范
Did not detect default resource location for test class xxxx
【mindspore】【Categorical】softmax数据放入Categorical类出现和不为1的错误
zabbix添加监控主机和自定义监控项
The same is a primary test, why does he pay 5,000 yuan more than me?
Jackson的ObjectMapper在项目中的主要运用
Do you know these basic types of software testing?
随机推荐
微信小程序相互跳转如何携带参数
1413.Minimum Value to Get Positive Step by Step Sum
TCP协议之《自动阻塞CORK控制》
torch.nn.CrossEntropyLoss()对应的MindSpore算子是哪个?
Pen paper records
【单调栈】【概念讲解&&模板代码】
2022华数杯思路分析
Classes and interfaces
请教各位confluence部署连接数据库成功,但是在后面建表设置的时候报错
线程和线程间通信(C语言)
TCP协议之《TSQ限值tcp_limit_output_bytes》
TCP协议之《数据与控制流程交叉时的延迟处理》
maya视图如何切换
zabbix添加监控主机和自定义监控项
How does a new tester do functional testing?Test thinking is really important
数据仓库建模实践
Neo4J 与 Cypher 查询语言基础
TCP协议之《MTU探测功能》
ZZULIOJ:1020: 两整数排序
The same is a primary test, why does he pay 5,000 yuan more than me?