当前位置:网站首页>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;
}边栏推荐
猜你喜欢

No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.

leetcode-218.天际线问题

PID与ADRC

2022华数杯思路分析

长沙:借网红的风,铺长红的路

全面深入了解什么是反向代理和负载均衡

matlab simulink response spectrum calculation

2022年P气瓶充装操作证考试题库及模拟考试

The same is a primary test, why does he pay 5,000 yuan more than me?

Embedded Sharing Collection 32
随机推荐
TCP协议之《ACK pingpong交互模式详解》
处理一些数据
Recommend several easy-to-use MySQL open source clients, it is recommended to collect
Embedded Sharing Collection 32
2022年P气瓶充装操作证考试题库及模拟考试
2022年危险化学品经营单位主要负责人题库及模拟考试
模型部署ONNX学习
【单调栈】【概念讲解&&模板代码】
matlab simulink response spectrum calculation
云程发轫,万里可期 | 云扩科技再次入选Gartner《2022年中国ICT技术成熟度曲线报告》
数据库设计中反映用户对数据要求的模式叫什么
js原型和原型链以及原型继承
2022年P气瓶充装操作证考试题库及模拟考试
TCP协议之《TSQ限值tcp_limit_output_bytes》
整理零碎东西
Did not detect default resource location for test class xxxx
Shell 文本三剑客 awk
Redis 定长队列的探索和实践
day17正则表达式作业
Pen paper records