全文预览

高校水电费管理系统设计(C++面向对象课程设计报告)

上传者:业精于勤 |  格式:doc  |  页数:46 |  大小:448KB

文档介绍
号的用户已存在!"<<endl;Р return;Р }Р stu[amount]=s;Р cout<<"添加成功!"<<endl;Р ofstream out_file("学生.txt",ios::app); //将添加记录更新到文件Р if(!out_file)Р {Р cout<<"打开失败!"<<endl;Р return;Р }Р out_file<<stu[amount].num<<" "<<stu[amount].name<<" "<<stu[amount].sex<<" "<<stu[amount].old<<" "<<stu[amount].classrome<<" "<<stu[amount].water<<" "<<stu[amount].watermoney<<" "<<stu[amount].power<<" "<<stu[amount].powermoney<<" "<<stu[amount].flag<<endl;Р out_file.close();Р amount++;Р}Рvoid Search() //查询信息Р{Рint chioce;Р cin>>chioce;Р switch(chioce)Р {Р case 1:Р {Р string name;Р cin>>name;Р int k=0;Р for(int i=0;i<amount;i++)Р {Р if(stu[i].name==name)Р {Р cout<<stu[i].num<<stu[i].name)<<stu[i].sex <<stu[i].old<<stu[i].classrome<<stu[i].water<<stu[i].watermoney <<stu[i].power<<stu[i].powermoney<<stu[i].flag<<"\n"<<endl;

收藏

分享

举报
下载此文档