热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_45833995
三年工作经验的应届毕业生
4 年前
trueweixin_45833995

编程应该花80%的时间在基础上,18%的时间花在框架上,2%的时间花在英语上。6月份要多学基础部分了

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
有大佬看看哪有问题吗#include<iostream>#include<cmath>using namespace std;class Point{double X,Y;public: Point(double a = 0,double b = 0); double GetX(); double GetY(); friend double GetLength( Point &A,Point &B); };double GetLength( Point &A,Point &B){double a = A.X - B.X;double b = A.Y - B.Y;return static_cast<double>(sqrt(a*a+b*b)) ;}int main(){Point P1(4,5),P2(1,1);cout<<"两点之间的距离为:"<<GetLength(P1,P2)<<endl; return 0;}
立即登录