/*************************************** ************************
C Language
AUTHOR: liuyongshui
**************************************** ***********************/
/*
Question 13: According to the meteorological classification method, it is usually in the Gregorian calendar 3 ~ May is spring,
6 ~ August is summer, 9 ~ November is autumn, December ~ The year February is winter.
Use the switch structure to write a function to output the corresponding season Based on the month.
*/
# Include <stdio. h>
Void season (int m); // the original function season Declaration
Int main ()
{
Int month;
Printf ("Enter the month :");
Scanf ("% d", & month );
Season (month );
Return 0;
}
// Function Definition
Void season (int m)
{
Switch (m)
{
Case 3:
Case 4:
Case 5:
Printf ("the month % d you entered is in spring \ n", m );
Break;
Case 6:
Case 7:
Case 8:
Printf ("the month % d you entered is in summer \ n", m );
Break;
Case 9:
Case 10:
Case 11:
Printf ("the month % d you entered is in autumn \ n", m );
Break;
Case 12:
Case 1:
Case 2:
Printf ("the month % d you entered is in winter \ n", m );
Break;
Default:
Printf ("the number you entered is not in the month of 0 to 12! ");
}
}