C++實現(xiàn)商店倉庫管理系統(tǒng)
本文實例為大家分享了C++實現(xiàn)商店倉庫管理系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下
一、問題描述
系統(tǒng)應(yīng)具有下列主要功能:輸入記錄功能:從鍵盤輸入貨物信息:商品代號,商品名稱, 數(shù)量,價格,所屬類別(如家用電器、日用品等)等;修改商品數(shù)量、刪除記錄功能、按商品代號查詢、按商品代號排序并顯示等功能。
二、基本要求
(1)使用面向?qū)ο缶幊趟枷刖帉戦_發(fā)過程中需要用到的類,使用繼承的方法構(gòu)造至少 3個類(即商品類(虛基類),家用電器類和日用品類(派生類)),另外再設(shè)計一個管理類,實現(xiàn)對商品的管理;
(2)輸入和輸出可以使用文本文件重定向輸入(保存數(shù)據(jù)為磁盤文件);也可以使用標(biāo)準(zhǔn)輸入輸出進行(提交時需要提交TXT格式輸入數(shù)據(jù))。包含各類商品信息,程序運行時進行初始化數(shù)據(jù),使用vector 數(shù)組存放對象指針。并能保存數(shù)據(jù)為磁盤文件。
(3)程序運行時使用菜單顯示添加(輸入)記錄,修改商品數(shù)量,瀏覽商品信息,按商品代號查找 ,刪除記錄。
(4)編寫同名 display() 成員函數(shù)既虛函數(shù),用來輸出所有商品的信息。要求對<< 和>>
運算符進行重載,實現(xiàn)信息的輸入輸出。
(5) 基本功能要求具有增、刪、改、查。
基本流程圖
#include <iostream>//基本的輸入輸出? #include <fstream> //文件操作? #include <cstring>//strcmp函數(shù),比較兩個字符串? #include <conio.h>//用getch(); #include <vector>//vector數(shù)組? #define SIZE 100 ?//采用宏定義,定義char數(shù)組的大小? using namespace std; class Goods//Goods類定義? { ?? ?public: ?? ??? ?Goods(){}//無參數(shù)無初值的構(gòu)造函數(shù) ,缺省構(gòu)造函數(shù)? ?? ??? ?char Number[SIZE];//編號? ?? ??? ?char Name[SIZE];//商品名? ?? ??? ?int Amount;//數(shù)量? ?? ??? ?float Price;//價格? ?? ??? ?char Type[SIZE];//類別? ?? ??? ?Goods * Next;//指針? ?? ??? ?vector<Goods> Manage; //vector數(shù)組的定義? ?? ??? ?friend ostream& operator<<(ostream& out,Goods& ?obj)//重載<<輸出運算符? ?? ??? ?{ ?? ??? ??? ??? ?out<<obj.Number<<obj.Name<<obj.Amount<<obj.Type; ?? ??? ?} ?? ??? ?friend istream& operator>>(istream& in,Goods& obj)//重載>>輸入運算符? ?? ??? ?{ ?? ??? ??? ??? ?in>>obj.Number>>obj.Name>>obj.Amount>>obj.Type; ?? ??? ?} ?? ??? ?void SetType()//設(shè)置商品類別? ?? ??? ?{?? ?cout<<" 請選擇種類:";?? ?cin>>Type;} ?? ??? ?void SetName()//設(shè)置商品名? ?? ??? ?{?? ?cout<<" 請輸入商品的名稱:"; cin>>Name;} ?? ??? ?void SetNumber()//設(shè)置商品編號? ?? ??? ?{?? ?cout<<" ?請輸入商品的編號:"; cin>>Number;} ?? ??? ?void SetPrice()//設(shè)置類商品價格? ?? ??? ?{cout<<" 請輸入商品單價:"; cin>>Price;} ?? ??? ?void SetAmount()//設(shè)置商品數(shù)量? ?? ??? ?{cout<<" 請輸入商品庫存:"; cin>>Amount;} ?? ??? ?void SetOther() //設(shè)置其他數(shù)據(jù)? ?? ??? ?{?? ?cout<<" ?請輸入商品價格:"; cin>>Price; ?? ??? ??? ?cout<<" ?請輸入存貨數(shù)量:"; cin>>Amount;} ?? ? ?? ??? ?void ReadFile(istream & in)//讀取文件? ?? ??? ?{?? ?in>>Name>>Type>>Number>>Price>>Amount;}?? ? ?? ??? ?void SetAll()//成員函數(shù) ?功能:輸入信息? ?? ??? ?{ ?? ??? ??? ?SetName(); ?? ??? ??? ?SetType(); ?? ??? ??? ?SetNumber(); ?? ??? ??? ?SetOther(); ?? ??? ? ?? ??? ?} ?? ??? ?void Show()//輸出商品信息? ?? ??? ?{?? ?cout<<"商品名: "<<Name<<endl<<"種類:"<<Type<<endl<<"編號: "<<Number<<endl<<"價格 "<<Price<<endl<<"商品庫存: "<<Amount<<endl<<endl;} }; class LifeGoods:public Goods//生活用品類? { ?? ?public: ?? ??? ?LifeGoods(){}//構(gòu)造函數(shù)? ?? ??? ?~ LifeGoods(){} //析構(gòu)函數(shù)? ?? ??? ?char Number[SIZE];//編號? ?? ??? ?char Name[SIZE];//商品名? ?? ??? ?int Amount;//數(shù)量? ?? ??? ?float Price;//價格? }; class electricLifeGoods:public Goods//家用電器類? { ?? ?electricLifeGoods() {}//構(gòu)造函數(shù)? ?? ?~electricLifeGoods(){}//析構(gòu)函數(shù)? ?? ?char Number[SIZE];//編號? ?? ?char Name[SIZE];//商品名? ?? ?int Amount;//數(shù)量? ?? ?float Price;//價格? }; class Manage:public Goods//管理類? { ?? ?public: ?? ??? ?Goods * Head,* End;//定義商品類的頭結(jié)點和尾節(jié)點的指針? ?? ??? ?int i;//記錄商品總數(shù)目? ?? ??? ?ifstream in;//打開文件輸入信息? ?? ??? ?ofstream out;//關(guān)閉文件儲存信息? ?? ??? ?Manage();//構(gòu)造函數(shù)? ?? ??? ?~Manage();//析構(gòu)函數(shù)? ?? ??? ?void AddGoods();//添加商品信息? ?? ??? ?void ShowMenu(int n);//顯示菜單,參數(shù)n用于switch進行增刪改查作? ?? ??? ?void FindGoods();//查找商品? ?? ??? ?void SaveGoods();//保存商品信息? ?? ??? ?void ChangeGoods();//修改商品內(nèi)容? ?? ??? ?void DelGoods();//刪除商品信息? ?? ??? ?int ListCount();//計算商品個數(shù) ?? ??? ?void Display()//顯示所有商品信息? ?? ??? ?{ ?? ??? ??? ?system("cls"); //清空屏幕,美觀? ?? ??? ??? ?i=0; ?? ??? ??? ?for(Goods * goods=Head->Next;goods!=End;goods=goods->Next)//從頭結(jié)點循環(huán)到尾節(jié)點,輸出全部的商品信息? ?? ??? ??? ?{ ?? ??? ??? ??? ?goods->Show(); //輸出每一個結(jié)點的各條信息? ?? ??? ??? ??? ?i++; ?? ? ? ? ? ?} ?? ??? ??? ?cout<<"共有"<<i<<"個商品"<<"\n"<<endl;?? ? ?? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ?getch(); ?? ??? ?} ?? ??? ?Goods *FindName(char * Name)//按姓名查找? ?? ??? ?{ ?? ??? ??? ?for(Goods * goods=Head;goods->Next!=End;goods=goods->Next)//匹配成功則返回上一個指針,不成功就返回空 ?? ??? ??? ??? ?if(!strcmp(goods->Next->Name,Name))return goods; ?? ??? ??? ??? ?return NULL; ?? ??? ?} ?? ??? ?Goods *FindNumber(char * Number)//按編號查找? ?? ??? ?{ ?? ??? ??? ?for(Goods * goods=Head;goods->Next!=End;goods=goods->Next)//匹配成功則返回上一個指針,不成功就返回空 ?? ??? ??? ??? ?if(!strcmp(goods->Next->Number,Number))return goods; ?? ??? ? ?? ? return NULL; ?? ??? ?} };? void Manage::AddGoods()//從鍵盤輸入商品信息 { ?? ?system("cls");//清空屏幕? ?? ?ShowMenu(1);//調(diào)用菜單函數(shù)? ?? ?End->SetName(); ?? ?End->SetType(); ?? ?do ?? ?{End->SetNumber();}while(FindNumber(End->Number));//當(dāng)編號不為空時輸入每一條信息? ?? ?End->SetOther(); ?? ?End->Next = new Goods;//開辟新空間,存儲新的商品信息? ?? ?End=End->Next; ?? ?cout<<"添加成功!"<<endl; ?? ?SaveGoods(); ?? ?cout<<"按任意鍵繼續(xù)......"; ?? ?getch(); } Manage::Manage() ?? ?//構(gòu)造函數(shù)在類外實現(xiàn)? { ?? ?Head=new Goods;//開辟一個新的結(jié)點,讓頭指針指向新結(jié)點? ?? ?Head->Next=new Goods;? ?? ?End=Head->Next; ?? ?in.open("倉庫.txt");//打開倉庫文件? ?? ?if(!in)//如果打開失敗? ?? ??? ?cout<<"沒有庫存"<<endl; ?? ?else ?? ?{ ?? ??? ?while(!in.eof())//循環(huán)讀入倉庫文件內(nèi)的數(shù)據(jù),直到空為止? ?? ??? ?{ ?? ??? ??? ?End->ReadFile(in); ?? ??? ??? ?if(End->Name[0]=='\0')break;//當(dāng)名字為0是結(jié)束讀取? ?? ??? ??? ?End->Next=new Goods; ?? ??? ??? ?End=End->Next; ?? ??? ?} ?? ??? ?in.close();//關(guān)閉文件? ?? ??? ?cout<<" 讀取商品信息成功!"<<endl<<endl; ?? ?} } void Manage::ShowMenu(int n)//菜單 ,參數(shù)不同調(diào)用不同的菜單? { ?? ?switch(n) //根據(jù)n來調(diào)用不同的菜單? ?? ?{ ?? ??? ?case 1: ?? ??? ?{ ?? ??? ??? ?cout<<"************************************************************"<<endl ?? ??? ??? ??? ?<<"* ? ? ? ? 1、生活用品 ? ? ? ? ? ? ?2、家用電器 ? ? ? ? ? ? *" <<endl? ?? ??? ??? ? ? ?<<"************************************************************"<<endl; ?? ??? ?break;} ?? ??? ?case 2: ?? ??? ?{ ?? ??? ?system("cls"); ?? ??? ?cout<<"************************************************************"<<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? 商 店 倉 庫 管 理 系 統(tǒng) ? ? ? ? ? ? ? ?*" <<endl? ?? ??? ??? ?<<"************************************************************"<<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?1、增 加 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?2、顯 示 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?3、查 找 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?4、刪 除 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?5、修 改 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?6、保 存 商 品 ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? ?0、退 出 系 統(tǒng) ? ? ? ? ? ? ? ? ? ? ?*" <<endl ?? ??? ??? ?<<"************************************************************"<<endl ?? ??? ??? ?<<endl<<" ?請選擇(0-7): ?"; ?? ??? ?break;} ?? ??? ?case 3: ?? ??? ?{ ?? ??? ?system("cls"); ?? ??? ?cout<<"************************************************************"<<endl ?? ??? ??? ?<<"* ? ? ?1、修改商品名 ? ? ? ? ? ? 4、修改價格 ? ? ? ? ? ? ? *" <<endl? ?? ??? ??? ?<<"* ? ? ?2、修改類別 ? ? ? ? ? ? ? 5、修改編商品量 ? ? ? ? ? *" <<endl? ?? ??? ??? ?<<"* ? ? ?3、修改編號 ? ? ? ? ? ? ? 10、修改全部 ? ? ? ? ? ? ? *" <<endl? ?? ??? ??? ?<<"************************************************************"<<endl ?? ??? ??? ?<<endl<<" ?請選擇: ?"; ?? ??? ?break; ?? ??? ?} ?? ??? ?case 5: ?? ??? ?{ ?? ??? ?system("cls"); ?? ??? ?cout<<"************************************************************"<<endl ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? 1、按商品名查找 ? ? ? ? ? ? ? ? ? ? ?*" <<endl? ?? ??? ??? ?<<"* ? ? ? ? ? ? ? ? ? ? 2、按商品編號查找 ? ? ? ? ? ? ? ? ? ?*" <<endl? ?? ??? ??? ?<<"************************************************************"<<endl?? ? ?? ??? ??? ?<<endl<<" ?請選擇: ?"; ?? ??? ?break; ?? ??? ?} ?? ?} } Manage::~Manage() //析構(gòu)函數(shù)? { ?? ?for(Goods * temp;Head->Next!=End;) //循環(huán)遍歷,釋放所有的指針? ?? ?{ ?? ??? ?temp=Head->Next; ?? ??? ?Head->Next=Head->Next->Next; ?? ??? ?delete temp; ?? ?} ?? ?delete Head,End; } void Manage::FindGoods() //查找商品? { ?? ?system("cls"); ?? ?char Name[SIZE] ,Number[10]; ?? ?int Input; ?? ?Goods * goods=NULL;//初始化指針? ?? ?ShowMenu(5);//調(diào)用菜單? ?? ?cin>>Input;//按姓名或者編號查詢? ?? ?switch(Input) ?? ?{ ?? ??? ?case 1:{cout<<" 請輸入要查找的商品的名稱:";cin>>Name; ?? ??? ??? ?if(goods=FindName(Name)) ?? ??? ??? ?{?? ?goods->Next->Show(); ?? ??? ??? ? ? ?? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ? ?? ? ? ?? ?getch();} ?? ??? ??? ?else{ ?? ??? ??? ??? ?cout<<" 沒有找到該名稱的商品!"<<'\n'<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();}?? ?}break; ?? ??? ?case 2: ?? ??? ??? ?{ ?? ?cout<<" 請輸入要查找的商品的編號:";cin>>Number; ?? ??? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ?goods->Next->Show(); ?? ??? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ??? ?getch(); ?? ??? ??? ??? ?} ?? ??? ??? ??? ?else{ ?? ??? ??? ??? ??? ?cout<<" 沒有找到該編號的商品!"<<'\n'<<endl; ?? ??? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ??? ?getch(); ?? ??? ??? ??? ?} ?? ??? ? }break; ?? ?}?? ??? ? } void Manage::ChangeGoods() //修改商品信息 { ?? ?ShowMenu(3);//調(diào)用菜單? ?? ?int Input; ?? ?cin>>Input; ?? ?switch(Input) ?? ?{ ?? ??? ?case 1: ?? ??? ?{ ?? ??? ??? ?char Number[SIZE]; ?? ??? ??? ?Goods * goods=NULL; ?? ??? ??? ?cout<<" 請輸入要修改的商品的編號:";cin>>Number; ?? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ?{ ?? ?cout<<" 已找到商品的信息,請輸入新的信息!"<<endl; ?? ??? ??? ??? ?goods->Next->SetName();//將新輸入的姓名存到磁盤中? ?? ??? ??? ??? ?cout<<"修改成功!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();} ?? ??? ??? ?else{ ?? ??? ??? ??? ??? ?cout<<" ?未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ??? ?getch(); ?? ??? ??? ??? ?} ?? ??? ??? ??? ?break; ?? ??? ??? ?} ?? ??? ?case 2: ?? ??? ?{ ?? ??? ? ? ?char Number[SIZE]; ?? ??? ??? ?Goods * goods=NULL; ?? ??? ??? ?cout<<" 請輸入要修改的商品的編號:";cin>>Number; ?? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ?{ ?? ??? ??? ??? ?cout<<" 已找到商品的信息,請輸入新的信息!"<<endl; ?? ??? ??? ??? ?goods->Next->SetType();//將新輸入的類別存到磁盤中? ?? ??? ??? ??? ?cout<<"修改成功!"<<endl; ?? ??? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ??? ?getch();} ?? ??? ??? ?else{ ?? ??? ??? ??? ?cout<<" 未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();}?? ?break;} ?? ??? ?case 3: ?? ??? ??? ?{ ?? ??? ??? ?char Number[SIZE]; ?? ??? ??? ?Goods * goods=NULL; ?? ??? ??? ?cout<<" 請輸入要修改的商品的編號:";cin>>Number; ?? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ?{ ?? ??? ??? ??? ?cout<<" 已找到商品的信息,請輸入新的信息!"<<endl; ?? ??? ??? ??? ?goods->Next->SetNumber();//將新輸入的編號存到磁盤中? ?? ??? ??? ??? ?cout<<"修改成功!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch(); ?? ??? ??? ?} ?? ??? ??? ?else{ ?? ??? ??? ??? ?cout<<" 未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();}?? ?break;} ?? ??? ?case 4: ?? ??? ??? ?{ ?? ??? ??? ?char Number[SIZE]; ?? ??? ??? ?Goods * goods=NULL; ?? ??? ??? ?cout<<" 請輸入要修改的商品的編號:";cin>>Number; ?? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ?{ ?? ??? ??? ??? ?cout<<" 已找到商品的信息,請輸入新的信息!"<<endl; ?? ??? ??? ??? ?goods->Next->SetPrice();//將新輸入的價格存到磁盤中? ?? ??? ??? ??? ?cout<<"修改成功!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();} ?? ??? ??? ?else ?? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ?cout<<" 未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ??? ?getch();} ?? ??? ??? ??? ?break; ?? ??? ??? ?} ?? ??? ?case 5: ?? ??? ?{ ?? ??? ??? ?char Number[SIZE]; ?? ? ??? ??? ?Goods * goods=NULL; ?? ??? ??? ?cout<<" 請輸入要修改的商品的編號:";cin>>Number; ?? ??? ??? ?if(goods=FindNumber(Number)) ?? ??? ??? ?{? ?? ??? ??? ??? ?cout<<" 已找到商品的信息,請輸入新的信息!"<<endl; ?? ??? ??? ??? ?goods->Next->SetAmount();//將新輸入的數(shù)量存到磁盤中? ?? ??? ??? ??? ?cout<<"修改成功!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();} ?? ??? ??? ?else{? ?? ??? ??? ??? ?cout<<" 未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ??? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ??? ??? ?getch();}?? ?break; ?? ??? ??? ?} ?? ??? ?}?? ? } void Manage::DelGoods() // 刪除信息? { ?? ?system("cls"); ?? ?char Number[SIZE]; ?? ?Goods * goods=NULL,*temp=NULL; ?? ?cout<<" 請輸入要刪除的商品的編號:"<<endl;cin>>Number; ?? ?if(goods=FindNumber(Number))//調(diào)用 FindNumber()函數(shù)按照編號查找,找到后進行刪除? ?? ?{ ?? ??? ?temp=goods->Next; ?? ??? ?goods->Next=goods->Next->Next;? ?? ??? ?delete temp; ?? ??? ?cout<<" 刪除成功!"<<endl; ?? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ?getch(); ?? ?} ?? ?else ?? ?{ ?? ??? ?cout<<" 未找到指定商品,請確認(rèn)后重新查找!"<<endl; ?? ??? ?cout<<"按任意鍵繼續(xù)......"; ?? ??? ?getch(); ?? ?} } int Manage::ListCount() //統(tǒng)計當(dāng)前鏈表的記錄總數(shù),返回一個整數(shù) { ?? ?if(! Head) ?? ??? ?return 0; ?? ?int n=0; ?? ?for(Goods * goods=Head->Next;goods!=End;goods=goods->Next)//對所有結(jié)點進行遍歷,遍歷結(jié)束后n即為總數(shù)? ?? ??? ?n++; ?? ?return n; } void Manage::SaveGoods() // 將磁盤中的文件寫入文本文件中? { ?? ?out.open("倉庫.txt"); ?? ?for(Goods *goods=Head->Next;goods!=End;goods=goods->Next)//循環(huán)寫入? ?? ??? ?out<<goods->Name<<" "<<goods->Type<<" "<<goods->Number<<" "<<goods->Price<<" "<<goods->Amount<<'\n'; ?? ?out.close(); ?? ?cout<<"信息保存成功"<<endl; } int main() //主函數(shù) { ?? ?Manage G; ?? ?cout<<endl<<endl<<endl<<endl ?? ?<<"\t\t\t歡迎進入商品倉庫管理系統(tǒng),按任意鍵繼續(xù)"<<endl<<endl<<endl<<endl;? ?? ?getch();?? ? ?? ?int Input; ?? ?bool quit =false; ?? ?while(!quit) ?? ?{ ?? ??? ?G.ShowMenu(2); ?? ??? ?cin>>Input; ?? ??? ?switch(Input) ?? ??? ?{? ?? ??? ??? ?case 0:{quit=true;break;} ?? ??? ??? ?case 1:{G.AddGoods();break;} ?? ??? ??? ?case 2:{G.Display();break;} ?? ??? ??? ?case 3:{G.FindGoods();break;} ?? ??? ??? ?case 4:{G.DelGoods();break;} ?? ??? ??? ?case 5:{G.ChangeGoods();break;} ?? ??? ??? ?case 6:{G.SaveGoods();break;} ?? ??? ??? ?} ?? ??? ?} ?? ?return 0;? }
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
C語言二維數(shù)組應(yīng)用實現(xiàn)掃雷游戲
這篇文章主要為大家詳細(xì)介紹了C語言二維數(shù)組應(yīng)用實現(xiàn)掃雷游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-06-06C++構(gòu)造函數(shù)的一些注意事項總結(jié)
構(gòu)造函數(shù)是創(chuàng)建類對象,并且在創(chuàng)建完成前,對類進行初始化的特殊函數(shù),下面這篇文章主要給大家介紹了關(guān)于C++構(gòu)造函數(shù)的一些注意事項,需要的朋友可以參考下2021-11-11c++如何在主函數(shù)文件中調(diào)用其他函數(shù)文件
這篇文章主要介紹了c++如何在主函數(shù)文件中調(diào)用其他函數(shù)文件問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2023-08-08