WEEK 1: Project 1 use the switch structure to write a function to output the corresponding season Based on the month

Source: Internet
Author: User
/**ProgramCopyright and version description Section * copyright (c) 2013, Yantai University Computer college student * All rightsreserved. * file name: riqi. CPP * Author: Li Yang * Completion Date: July 15, March 5, 2013 * version: V1.0 * input Description: month * Problem description: Input month, season */# include <iostream> using namespace STD; int main () {int month; cout <"Enter month:"; CIN> month; switch (month) {Case 3: Case 4: Case 5: cout <"this month is Spring" <Endl; break; Case 6: Case 7: Case 8: cout <"this month is summer" <Endl; break; Case 9: Case 10: Case 11: cout <"this month is Autumn" <Endl; break; case 12: Case 1: Case 2: cout <"this month is winter" <Endl; break;} return 0 ;}
 
 

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.