钱包芳
钱包芳
年轻真好!
关注数: 3
粉丝数: 8
发帖数: 25
关注贴吧数: 10
为什么是死循环 #include<iostream> using namespace std; void showmenu(); int main() { showmenu(); int choice; cin>>choice; while( choice!= 'c' && choice!= 'p' && choice!= 't' && choice != 'g') { cout<<"Please enter c,p,t or g:"; } switch(choice) { case 'c': cout<<"A maple is a carnivore."; break; case 'p': cout<<"A maple is a pinanist."; break; case 't': cout<<"A maple is a tree."; break; case 'g': cout<<"A maple is a game."; break; default: break; } return 0; } void showmenu() { cout<<"Please enter one of the following choice:"<<endl; cout<<"c)carnivore p)pianist"<<endl; cout<<"t)tree g)game"<<endl; }//为什么是无限循环?
为什么是死循环 #include<iostream> using namespace std; void showmenu(); int main() { showmenu(); int choice; cin>>choice; while( choice!= 'c' && choice!= 'p' && choice!= 't' && choice != 'g') { cout<<"Please enter c,p,t or g:"; } switch(choice) { case 'c': cout<<"A maple is a carnivore."; break; case 'p': cout<<"A maple is a pinanist."; break; case 't': cout<<"A maple is a tree."; break; case 'g': cout<<"A maple is a game."; break; default: break; } return 0; } void showmenu() { cout<<"Please enter one of the following choice:"<<endl; cout<<"c)carnivore p)pianist"<<endl; cout<<"t)tree g)game"<<endl; }//为什么是无限循环?
怎么大小写都没进行转换?为什么这些函数都没被调用,要如何改正
第5行没缺右括号呀,怎么会报错呢?
这个头文件和文件的路径要在编辑框里怎么设置?真的不会操作
1
下一页