各位大神能帮小白找下错吗?我已经内流满面了

cx199905 2019-03-25 05:45:10
#include <iostream> #include <string> using namespace std; class Date{ private : int day,moon,year; public: Date (int d=1,int m=1,int y=2019){day=d;moon=m;year=y;} Date (Date &di); ~Date (); int getd(){return day;} int getm(){return moon;} int gety(){return year;} void show (); }; Date::Date(Date &di){ day=di.day; moon=di.moon; year=di.year;} class People{ private: Date d; int no,n; string s; public: People (int num,int nom,string st,Date db); People (People &p); void set (int nom,int num,string st); void show (); };People::People (People &p):no(p.no),n(p.n),s(p.s),d(p.d) { } void People::set (int nom,int num,string st) { no=nom; n=num; s=st; } People::People(int nom,int num,string st,Date db):no(nom),n(num),s(st),d(db) { } inline void People ::show (){ cout<<no<<" "<<n<<" "<<s<<endl; } int main(){ Date da(1,1,2019); People pe(0,0,0,da); pe.set (101,4229,"cxv"); pe.show(); People pe1=pe; pe1.show (); return 0;} 非技术区
...全文
27 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧