Week 10 computer task Project 6: Doudou rewrite Task 2

Source: Internet
Author: User
/** copyright (c) 2012, Emy of computer science, Yantai University * All Rights Reserved. * Author: Zhao guanzhe * Completion Date: July 15, October 30, 2012 * version number: V1.0 ** enter Description: none * Problem description: doubebean *  Program  output: Eat? Sleeping? Beans? * Problem Analysis: Use the switch statement to rewrite *  algorithm  Design: omitted */# include 
  
    using namespace STD; int main () {int A; do {cout <"* 1. dinner "
   
     A; if (a> 3) cout <" \ 007 select error! "
    
   
  

Running result:


Experience:

Using the switch statement, I personally think that the user-defined function is easier than Mr. He's, but I want to learn the User-Defined Function in the next chapter!

Knowledge Point summary:

Pay attention to the use of curly brackets and end with "Congratulations! You have finished a job !" It must be placed in a proper position. If you make a mistake, it is very likely that after "incorrect selection" is output, "Congratulations !"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.