65,208
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
using namespace std;
class A
{
private:
int a;
string s;
public:
A()
{
a=0;
s="";
}
A(int a,string& s)
{
this->a=a;
this->s=s;
}
A(const A& p)
{
//a=p.a;
//s=p.s;
a=p.geta(); //外什么用这两句替换上面两句会编译出错
s=p.gets();
}
int geta() const
{
return a;
}
string gets() const
{
return s;
}
};
int main()
{
return 0;
}