ex10.1

来源:互联网 发布:炉石传说淘宝成品号 编辑:程序博客网 时间:2024/06/17 14:19
include<iostream>
using namespace std;
class account
{string name;
int money;
int num;
public:
account(string a,int x, int y)
{name=a;
money=x;
num=y;
}
void show()
{cout<<"user name is "<<name<<endl;
cout<<"he has :"<<money<<endl;
cout<<"his hum is"<<num<<endl;
}
~account()
{cout<<"bye"<<endl;
}
};
int main()
{int a,b;
string c;
cout<<"enter the date"<<endl;
cout<<"name"<<endl;
cin>>c;
cout<<"num"<<endl;
cin>>a;
cout<<"money"<<endl;
cin>>b;
account one(c,a,b);
int flag=0;
cout<<"push the date?"<<endl;
cin>>flag;
if(flag)
one.show();
return 0;
}
0 0
原创粉丝点击