1815[Distance]
2013-11-07 21:18
369 查看
求两个坐标点的距离- -
主要是输出保证有两个小数点~
搞定~
什么时候才能刷题刷成小牛呢[叹气]
主要是输出保证有两个小数点~
#include<iostream> #include<cmath> #include <iomanip> using namespace std; int main() { int n; double x1, y1 ,x2, y2; double y; cin >> n; while( n-- ) { cin >> x1 >> y1 >> x2 >> y2; y = (x1-x2) * ( x1-x2 ) + (y1-y2) * (y1-y2); y = sqrt( y ); cout << setiosflags( ios::fixed ) << setprecision( 2 ); cout << y << endl; } return 0; }
搞定~
什么时候才能刷题刷成小牛呢[叹气]
相关文章推荐
- 用distance和advance把const_iterator转化成iterator
- The Farthest Distance in the World
- the furthest distance in the world
- POJ_1657_Distance on Chessboard
- poj1657——Distance on Chessboard
- Edit-Distance的算法分析与实现
- UVA 729 - The Hamming Distance Problem
- 使用stl中的 advance和 distance 方法来进行iterator的加减
- poj 1815(最小割+枚举)
- POJ 2689 Prime Distance
- 729 - The Hamming Distance Problem
- POJ 1815 最小割
- Mahalanobis distance
- poj 2749 & hdu 1815 Building roads(2-SAT + 二分,好题)
- Calculate the distance between sets of vectors.
- POJ 2689 - Prime Distance 任意区间内筛素数
- 关于GestureDetector.OnGestureListener的onScroll参数distance问题
- HDU4712-----Hamming Distance------超级大水题
- LA 5854 Long Distance Taxi (SPFA 变型) - from lanshui_Yang
- What is Mahalanobis distance?