} system(\ infile.close(); }
void book::showC() //显示类型C {
ifstream infile(\ if (!infile) {
cout< bool flag = true; while(infile>>name>>number>>type>>email) { if(type==\ { cout< void book::show() { char ch1; cout<<\你想输出哪一类信息:\ cout<<\办公类 \个人类 \商务类 \ cout<<\请选择:\ cin>>ch1; switch(ch1) { case 'A': showA(); 21 break; case 'B': showB(); break; case 'C': showC(); break; default: cout<<\出错了!\ } } void book::save() //保存 { ifstream in(\ if(!in) { cout<<\对不起!文件打开失败!\ exit(0); } int n=0; char line[1024]; in.seekg(0L,ios::beg); do { in.getline(line,1024); n++; } while (!in.eof()); in.close(); if (n>15) { cout<<\存储空间已满!不能再录入数据!\ } else { ofstream outfile(\ if (!outfile) { cout < 22 outfile< outfile.close(); //关闭文件 } } int main() { book d; int choose; int choose1; while(choose=enter()) { switch(choose) { case 1: system(\ while(check()==0) while(choose1=d.enter1()) { switch(choose1) { case 1: d.addPer(); break; case 2: d.delPer(); break; case 3: d.alter(); break; case 4: d.call(); break; case 5: d.show(); break; case 6: d.showall(); break; 23 } } } return 0; case 7: exit(0); default : break; } } break; case 2: login(); break; case 3: exit(0); break; default : break; 五、测试说明 1、登录界面 24