当前位置: > X=xx,...
题目
X=xx,
#include
#include
using namespace std;
class point
{
public:
point(int xx=0,int yy=0) {X=xx;Y=yy;}
int getX() {return X;}
int getY() {return Y;}
friend float fdist(point &a,point &b);
private:
int X,Y;};
float fdist(point &p1,point &p2)
{double x=double(p1.X-p2.X);
double y=double(p1.Y-p2.Y);
return float (sqrt(x*x+y*y));
}
void main(){point myp1(1,1),myp2(4,5);
cout

提问时间:2021-04-24

答案
xx,yy是作为一个变量,是个整体的,不能分开,程序中没有x或y,单写一个程序会出错,X=xx,Y=yy是赋值语句,就是把xx的值赋给X,yy的值赋给Y
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.