一般函数
来源:互联网 发布:网络交友骗色 编辑:程序博客网 时间:2024/04/30 16:50
- /*
- *Copyright(c)2016,烟台大学计算机与控制工程学院
- *All rights reserved
- *文件名称:123.cpp
- *作 者:隋宗涛
- *完成日期:2016年5月9日
- *版 本 号:v1.0
- *
- *问题描述:完成求点类中距离的任务,利用一般函数求两点间距离的函数,并设计main()函数完成测试。
- *输入描述:无。
- *程序输出:一个整数,代表距离。
- */
- #include<iostream>
- #include<cmath>
- using namespace std;
- class Point
- {
- public:
- Point(double xx=0,double yy=0):x(xx),y(yy){}
- double getX()
- {
- return x;
- }
- double getY()
- {
- return y;
- }
- private:
- double x,y;
- };
- void n1(Point &p1,Point &p2)
- {
- double n;
- double x=p1.getX()-p2.getX();
- double y=p1.getY()-p2.getY();
- n=(double)sqrt(x*x+y*y);
- cout<<n<<endl;
- }
- int main()
- {
- Point pp1(3.0,3.0),pp2(5.0,5.0);
- n1(pp1,pp2);
- return 0;
- }
0 0
- 一般函数
- 一般函数
- 一般时控函数
- 一般时控函数
- 一般的函数
- 一般时间函数
- 一般时间函数
- 构造函数和一般函数
- 成员函数,友元函数,一般函数
- 友元函数,一般函数,成员函数
- 一般存储过程和函数
- oracle中的函数(三)一般函数
- 构造函数与一般函数的区别
- 说说内联函数和一般函数
- inline函数和一般的函数
- 构造函数和一般函数的区别
- 构造函数和一般函数(1)
- 构造函数和一般函数的区别
- Android Studio好用的插件
- thinkphp 返回ajax 及switch
- Java--类和对象--回合制对战游戏
- leetcode 19. Remove Nth Node From End of List
- No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in t
- 一般函数
- 【一天一道LeetCode】#47. Permutations II
- 面向对象的六大原则
- java 数据装箱及练习-对一个字符串中的数字进行排序
- 在FragmentLayout里面添加翻页圆点
- 友元函数
- JSTL的if判断
- svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
- 网站运营方案SEO【运营】