16_2.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //16_2.cpp
- #include <iostream.h>
- #include "account.h"
- #include "savings.h"
- #include "checking.h"
- void main()
- {
- unsigned aN;
- float val;
- cout <<"please input some account and savings:n";
- cin >>aN >>val;
- while(aN){
- new Savings(aN,val);
- cout <<"please input some account and savings:n";
- cin >>aN >>val;
- }
- cout <<"please input some account and checking:n";
- cin >>aN >>val;
- while(aN){
- new Checking(aN,val);
- cout <<"please input some account and checking:n";
- cin >>aN >>val;
- }
- for(Account* p=Account::First(); p; p=p->Next())
- cout <<p->AccountNo() <<" " <<p->AcntBalan() <<endl;
- for(Account* p=Account::First(); p; ){
- Account* t=p;
- p=p->Next();
- delete t;
- }
- Account::First()=NULL;
- }