代码如下:
#include<vector>
#include<iostream>
#include<ctime>
#include<iterator>//直接使用万能头文件#include<bits/stdc++.h>
using namespace std;
struct tim{
string caozuo1;
int year,month,day,hour,minute,second;
double money1,money2;
};//定义的时间结构体,存交易记录
class Account{
string na;
string hao;
double money;
vector<tim>time11;
public:
Account(string no,string name,double amount);
Account();
void huaqian();
void cunqian();
void getjl();
double getamount();
~Account();
};
Account::Account(string name,string no,double amount)
{
na=name;
hao=no;
money=amount;
}//初始化列表
Account::Account()
{
na="name";
hao="1234";
money=0;
}
Account::~Account()
{
cout<<"您的账户余额为:"<<getamount()<<endl;
cout<<"请全部取出";
huaqian();
}//析构函数
void Account::huaqian()
{
double money;
cout<<"输入取钱金额:"