qq84435

6.3

#include <iostream>
using namespace std;
void main63()
{
	cout<<"Please enter one of the following choices :"<<endl;
	cout<<"c) carnivore              p) pianist"<<endl;
	cout<<"t) tree                  g) game"<<endl;
	char ch;
	//boolean
	bool flag=true; //用于跳出循环
	while(flag)
	{
		cout<<"\nPlease enter a a c,p,t,or g:";
		cin>>ch;
		switch(ch)
		{
		case \'c\':cout<<"A mape is a carnivore",flag=false;break;
		case \'p\':cout<<"A mape is a pianist",flag=false;break;
		case \'t\':cout<<"A mape is a tree",flag=false;break;
		case \'g\':cout<<"A mape is a game",flag=false;break;
		default:;
		}	
	
}

		system("pause");

}


分类:

技术点:

相关文章:

  • 2021-08-15
  • 2021-08-19
  • 2022-12-23
  • 2021-08-16
  • 2021-12-28
  • 2021-12-06
  • 2021-05-06
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2022-12-23
  • 2021-09-11
  • 2021-06-13
  • 2021-07-01
  • 2021-07-02
  • 2022-03-08
相关资源
相似解决方案