64,642
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class date
{
private:
int x;
float y;
public:
void show();
date();
date(int ,float);
date(const date &a);
};
date::date()
{
}
date::date(int a,float b)
{
this->x=a;
this->y=b;
}
date::date(const date &a)
{
x =a.x;
y =a.y;
}
void date::show()
{
cout << this->x<<cout<<endl;
cout << this->y<<cout<<endl;
}
int main(void)
{
date hu(12,13.2);
date yoo=hu;
hu.show();
yoo.show();
return 0;
}
#include <iostream>
using namespace std;
class date
{
private:
int x;
float y;
public:
void show();
date();
date(int ,float);
date(const date &a);
};
date::date()
{
}
date::date(int a,float b)
{
this->x=x;
this->y=y;
}
date::date(const date &a)
{
x =a.x;
y =a.y;
}
void date::show()
{
cout << this->x;
cout <<endl;
cout << this->y ;
cout<<endl;
}
int main(void)
{
date x(12,13.2);
date y=x;
x.show();
y.show();
return 0;
}
[/quote]
输出什么[/quote]
this->x = x …
没初始化 #include <iostream>
using namespace std;
class date
{
private:
int x;
float y;
public:
void show();
date();
date(int ,float);
date(const date &a);
};
date::date()
{
}
date::date(int a,float b)
{
this->x=x;
this->y=y;
}
date::date(const date &a)
{
x =a.x;
y =a.y;
}
void date::show()
{
cout << this->x;
cout <<endl;
cout << this->y ;
cout<<endl;
}
int main(void)
{
date x(12,13.2);
date y=x;
x.show();
y.show();
return 0;
}
[/quote]
输出什么#include <iostream>
using namespace std;
class date
{
private:
int x;
float y;
public:
void show();
date();
date(int ,float);
date(const date &a);
};
date::date()
{
}
date::date(int a,float b)
{
this->x=x;
this->y=y;
}
date::date(const date &a)
{
x =a.x;
y =a.y;
}
void date::show()
{
cout << this->x;
cout <<endl;
cout << this->y ;
cout<<endl;
}
int main(void)
{
date x(12,13.2);
date y=x;
x.show();
y.show();
return 0;
}
#include <iostream>
using namespace std;
class date
{
private:
int x;
float y;
public:
void show();
date();
date(int ,float);
date(const date &a);
};
date::date()
{
}
date::date(int a,float b)
{
this->x=x;
this->y=y;
}
date::date(const date &a)
{
x =a.x;
y =a.y;
}
void date::show()
{
cout << this->x;
cout <<endl;
cout << this->y ;
cout<<endl;
}
int main(void)
{
date x(12,13.2);
date y=x;
x.show();
y.show();
return 0;
}