- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class 季节{
- static void main(string[] arge) {
- Type mytype = typeof(int);//获取引用类型的信息
- Console.WriteLine("类型:{0}",mytype);
- Console.Read();
- Console.Read();
- Console.ReadLine();
- Console.WriteLine("----------------------------------");
- Console.WriteLine("请输入一个月份");
- int myMouth = int.Parse(Console.ReadLine());
- string mySeason="";
- switch(myMouth){
- case 12:
- case 1:
- case 2:
- mySeason = "您输入的月份属于冬季";
- break; //跳出switch语句
- case 3:
- case 4:
- case 5:
- mySeason = "您输入的月份属于春季";
- break;
- case 6:
- case 7:
- case 8:
- mySeason = "您输入的月份属于夏季";
- break;
- case 9:
- case 10:
- case 11:
- mySeason = "您输入的月份属于秋季";
- break;
- }
- Console.WriteLine(mySeason);
- Console.ReadLine();
- }
- }
- }
复制代码 |