zoukankan      html  css  js  c++  java
  • 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第6章编程练习3

    #include <iostream>
    using namespace std;
    void showmenu(void)
    {
    	cout<<"Please enter one of the following choices:
    "
    		"c) carnivore         p) pianist
    "
    		"t) tree              g) game
    ";
    }
    void ak(void)
    {
    	cout<<"Please enter a c,p,t, or g:";
    }
    int main()
    {
    	char input;
    	showmenu();
    	cin>>input;
    	while(input)
    	{
    		switch(input)
    		{
    			case 'c':cout<<"Ad is a carniore.";
    				break;
    			case 'p':
    				cout<<"Lynn is a pianist.";
    				break;
    			case 't':
    				cout<<"A maple is a tree.";
    				break;
    			case 'g':
    				cout<<" Swim is a game.";
    				break;
    			default: 
    				ak();
    		}
    		//showmenu();
    		cin>>input;
    	}
    	system("pause");
    	return 0;
    }
    
  • 相关阅读:
    记录一个异常
    ajax4
    ajax3
    ajax2
    ajax
    break与continue的区别
    Dom
    Dom元素的操作
    javascript (2)
    javascript
  • 原文地址:https://www.cnblogs.com/lynnycy/p/3452080.html
Copyright © 2011-2022 走看看