#include <string>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[])
{
char c;
while(true){
cout<<"main menu:"<<endl;
cout<<"l:left,r:right,q:quit->";
cin>>c;
if(c=='q')
break;
if(c=='l'){
cout<<"left menu:"<<endl;
cout<<"select a or b:";
cin>>c;
if(c=='a'){
cout<<"you chooose 'a'"<<endl;
continue;
}
if(c=='b'){
cout<<"you choose 'b'"<<endl;
continue;
}
else{
cout<<"you didn't choose a or b!"
<<endl;
continue;
}
}
if(c=='r'){
cout<<"right menu:"<<endl;
cout<<"select c or d:";
cin>>c;
if(c=='c'){
cout<<"you choose 'c'"<<endl;
continue;
}
if(c=='d'){
cout<<"you choose 'd'"<<endl;
continue;
}
else{
cout<<"you didn't choose c or d!"
<<endl;
continue;
}
}
cout<<"you must type l or r or q!"<<endl;
}
cout<<"quitting menu..."<<endl;
}
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[])
{
char c;
while(true){
cout<<"main menu:"<<endl;
cout<<"l:left,r:right,q:quit->";
cin>>c;
if(c=='q')
break;
if(c=='l'){
cout<<"left menu:"<<endl;
cout<<"select a or b:";
cin>>c;
if(c=='a'){
cout<<"you chooose 'a'"<<endl;
continue;
}
if(c=='b'){
cout<<"you choose 'b'"<<endl;
continue;
}
else{
cout<<"you didn't choose a or b!"
<<endl;
continue;
}
}
if(c=='r'){
cout<<"right menu:"<<endl;
cout<<"select c or d:";
cin>>c;
if(c=='c'){
cout<<"you choose 'c'"<<endl;
continue;
}
if(c=='d'){
cout<<"you choose 'd'"<<endl;
continue;
}
else{
cout<<"you didn't choose c or d!"
<<endl;
continue;
}
}
cout<<"you must type l or r or q!"<<endl;
}
cout<<"quitting menu..."<<endl;
}