手机找回--两点间的距离
来源:互联网 发布:方维社区o2o系统 源码 编辑:程序博客网 时间:2024/06/10 08:42
/** Copyright (c) 2013 烟台大学计算机与控制工程学院* All rights reserved* 作 者: 刘慧艳* 完成日期:2014 年6月13日* 版 本 号:v1.0* 问题描述:手机找回,实际是求两坐标间的距离* 样例输入:* 样例输出:* 问题分析:。*/#include <iostream>#include <cstdio>#include <cmath>#include <iomanip>using namespace std;class Point{public: Point(double a=0,double b=0,double c=0,double d=0):x1(a),y1(b),x2(c),y2(d) {} void input(); friend void output(Point &);private: double x1; double y1; double x2; double y2;};void Point::input(){ double a,b,c,d; cin>>a>>b>>c>>d; x1=a; y1=b; x2=c; y2=d;}void output(Point &p){ double l; l=sqrt(((p.x1-p.x2)*(p.x1-p.x2))+(p.y1-p.y2)*(p.y1-p.y2)); cout<<setiosflags(ios::fixed)<<setprecision(2); cout<<"There are "<<l<<" meters between xiaohui and her phone."<<endl;}int main(){ Point p1; p1.input(); output(p1); return 0;}
0 0
- 手机找回--两点间的距离
- 两点间的距离
- 两点间的距离
- 计算两点间的距离
- 求两点间的距离.
- 求两点间的距离
- 输出两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 求两点间的距离
- 计算两点间的距离
- 计算两点间的距离
- Linux关机命令详解 四个常用的linux关机命令
- 通过反射获取泛型<T>的class
- Android 线程刷新界面
- code review sum
- 【剑指offer】数值的整数次方
- 手机找回--两点间的距离
- Python 对新浪微博的元素 (Word, Screen Name)的词汇多样性分析
- 重载运算符+
- 传值
- 摘记
- centos 5 yum安装与配置vsFTPd FTP服务器
- 初级数据持久化
- 【OpenCV学习笔记】【异常处理】一(The Matrix is not continuous, thus its number of rows can not be changed)
- 为RT-Thread实现一个傻瓜式的工程向导工具(一)