📄 goodstore.cpp
字号:
cout<<"Please cin the location you want it to move to:"<<endl;
cin>>str2;
j=movebyamount(str1,str2,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 4: cout<<"Please cin the location of the good you want to change its' location:"<<endl;
cin>>str1;
cout<<"Please cin the location you want it to move to:"<<endl;
cin>>str2;
j=movebyloc(str1,str2,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 5: cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
}
break;
case 2: cout<<"***********************************************************"<<endl;
cout<<"*............................menu.........................*"<<endl;
cout<<"* 1.find based on goodsnum; *"<<endl;
cout<<"* 2.find based on goodsname; *"<<endl;
cout<<"* 3.find based on goodsamount; *"<<endl;
cout<<"* 4.find based on goodsloc; *"<<endl;
cout<<"* 5.quit; *"<<endl;
cout<<"***********************************************************"<<endl; //第二级菜单
cout<<"please choose the option:"<<endl;
cin>>opt3;
switch(opt3){
case 1: cout<<"Please cin the num of the good you want to find:"<<endl;
cin>>str1;
j=findbynum(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 2: cout<<"Please cin the name of the good you want to find:"<<endl;
cin>>str1;
j=findbyname(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 3: cout<<"Please cin the amount of the good you want to find:"<<endl;
cin>>str1;
j=findbyamount(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 4: cout<<"Please cin the location of the good you want to find:"<<endl;
cin>>str1;
j=findbyloc(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 5: cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
}
break;
case 3: cout<<"***********************************************************"<<endl;
cout<<"*............................menu.........................*"<<endl;
cout<<"* 1.delete based on goodsnum; *"<<endl;
cout<<"* 2.delete based on goodsname; *"<<endl;
cout<<"* 3.delete based on goodsamount; *"<<endl;
cout<<"* 4.delete based on goodsloc; *"<<endl;
cout<<"* 5.quit; *"<<endl;
cout<<"***********************************************************"<<endl; //第二级菜单
cout<<"please choose the option:"<<endl;
cin>>opt4;
switch(opt4){
case 1: cout<<"Please cin the num of the good you want to delete:"<<endl;
cin>>str1;
j=deletebynum(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 2: cout<<"Please cin the name of the good you want to delete:"<<endl;
cin>>str1;
j=deletebyname(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 3: cout<<"Please cin the amount of the good you want to delete:"<<endl;
cin>>str1;
j=deletebyamount(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 4: cout<<"Please cin the location of the good you want to delete:"<<endl;
cin>>str1;
j=deletebyloc(str1,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 5: cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
}
break;
case 4: cout<<"***********************************************************"<<endl;
cout<<"*............................menu.........................*"<<endl;
cout<<"* 1.add based on goodsnum; *"<<endl;
cout<<"* 2.add based on goodsname; *"<<endl;
cout<<"* 3.add based on goodsamount; *"<<endl;
cout<<"* 4.add based on goodsloc; *"<<endl;
cout<<"* 5.quit; *"<<endl;
cout<<"***********************************************************"<<endl; //第二级菜单
cout<<"please choose the option:"<<endl;
cin>>opt5;
switch(opt5){
case 1: cout<<"Please cin the num of the good you want to add:"<<endl;
cin>>str1;
cout<<"Please cin the name of the good you want to add:"<<endl;
cin>>str2;
cout<<"Please cin the amount of the good you want to add:"<<endl;
cin>>str3;
cout<<"Please cin the location of the good you want to add:"<<endl;
cin>>str4;
cout<<"Please cin the num before which good you want to add the new good to:"<<endl;
cin>>str5;
j=addbynum(str1,str2,str3,str4,str5,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 2: cout<<"Please cin the num of the good you want to add:"<<endl;
cin>>str1;
cout<<"Please cin the name of the good you want to add:"<<endl;
cin>>str2;
cout<<"Please cin the amount of the good you want to add:"<<endl;
cin>>str3;
cout<<"Please cin the location of the good you want to add:"<<endl;
cin>>str4;
cout<<"Please cin the name before which good you want to add the new good to:"<<endl;
cin>>str5;
j=addbyname(str1,str2,str3,str4,str5,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 3: cout<<"Please cin the num of the good you want to add:"<<endl;
cin>>str1;
cout<<"Please cin the name of the good you want to add:"<<endl;
cin>>str2;
cout<<"Please cin the amount of the good you want to add:"<<endl;
cin>>str3;
cout<<"Please cin the location of the good you want to add:"<<endl;
cin>>str4;
cout<<"Please cin the amount before which good you want to add the new good to:"<<endl;
cin>>str5;
j=addbyamount(str1,str2,str3,str4,str5,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 4: cout<<"Please cin the num of the good you want to add:"<<endl;
cin>>str1;
cout<<"Please cin the name of the good you want to add:"<<endl;
cin>>str2;
cout<<"Please cin the amount of the good you want to add:"<<endl;
cin>>str3;
cout<<"Please cin the location of the good you want to add:"<<endl;
cin>>str4;
cout<<"Please cin the loc before which good you want to add the new good to:"<<endl;
cin>>str5;
j=addbyloc(str1,str2,str3,str4,str5,p,first);
if(j==1)
cout<<"Success!!!"<<endl;
else
cout<<"fail!!!"<<endl;
cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
case 5: cout<<"Do you want to do any other operation(y/n)?"<<endl;
cin>>t;
if(t=='y')
opt6=1;
if(t=='n')
opt6=2;
switch(opt6){
case 1: goto menu1;
break;
case 2: break;
}
break;
}
break;
case 5: system("pause");
break;
}
system("pause");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -