个人收集整理仅供参考学习#include #include #include #include void menu(); using namespace std; class bus { public: void save();//录入信息void showall();// 显示所有公交路线void searchroute();//根据起始站和终点站查询路线void del();// 删除站点private: int route,station,price; string start; string end; string pass[100][30]; }; //------------- 录入路线信息 --------------- void bus::save() { string pass[100][30],busstart,busend; int busroute,busstation,busprice,i,m; ofstream outfile("c1.txt",ios::app); //----打开文件 ---- if(!outfile) { cerr<<" open error"<>busroute; route=busroute; m++; outfile<>busstation; station=busstation; outfile<>busstart; start=busstart; outfile<>busend; end=busend; outfile<>busprice; price=busprice; outfile<>pass[m][i]; if(pass[m][i]=="1") break; else outfile<