当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
多元函数的3D可视化,终于被我总结出来了,数学真是太美了
2022年P气瓶充装操作证考试题库及模拟考试
原型和原型链
【MindSpore功能】运行SSD-MobileNetV1 FPN样例报错
The so-called software testing ability is actually these 5 points
matlab simulink response spectrum calculation
基于Nonebot2的qq机器人如何测试超管账号
program internationalization
2022年起重机械指挥操作证考试题库及模拟考试
Do you know these basic types of software testing?
随机推荐
sql注入之宽字节注入,limit,order by
2022年起重机械指挥操作证考试题库及模拟考试
数据切片问题
Pytorch中的torch.index_select对应MindSpore哪个方法
leetcode 283:移动零
Embedded Sharing Collection 32
ES高亮显示语法
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
Jackson的ObjectMapper在项目中的主要运用
TCP协议之《Pacing功能》
Flink学习15:Flink自定义数据源
Qt 线程常用同步方式
一篇文章教你Pytest快速入门和基础讲解,一定要看
@Autowired注解 --required a single bean, but 2 were found出现的原因以及解决方法
Dynamic Web Development Fundamentals
c语言:通讯录(动态版本)
Flutter 如何安装 pub.dev 上的 package
1413.Minimum Value to Get Positive Step by Step Sum
golang gin 框架读取无法用 body 传递的表单参数
leetcode-218.天际线问题