A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 生活墨墨 中级黑马   /  2012-12-5 10:16  /  1250 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;

  5. namespace ConsoleApplication1
  6. {
  7. class 季节{
  8. static void main(string[] arge) {
  9. Type mytype = typeof(int);//获取引用类型的信息
  10. Console.WriteLine("类型:{0}",mytype);
  11. Console.Read();
  12. Console.Read();
  13. Console.ReadLine();
  14. Console.WriteLine("----------------------------------");
  15. Console.WriteLine("请输入一个月份");
  16. int myMouth = int.Parse(Console.ReadLine());
  17. string mySeason="";
  18. switch(myMouth){
  19. case 12:
  20. case 1:
  21. case 2:
  22. mySeason = "您输入的月份属于冬季";
  23. break; //跳出switch语句
  24. case 3:
  25. case 4:
  26. case 5:
  27. mySeason = "您输入的月份属于春季";
  28. break;
  29. case 6:
  30. case 7:
  31. case 8:
  32. mySeason = "您输入的月份属于夏季";
  33. break;

  34. case 9:
  35. case 10:
  36. case 11:
  37. mySeason = "您输入的月份属于秋季";
  38. break;
  39. }
  40. Console.WriteLine(mySeason);
  41. Console.ReadLine();
  42. }
  43. }
  44. }
复制代码

评分

参与人数 1技术分 +1 收起 理由
宋天琪 + 1

查看全部评分

1 个回复

倒序浏览
值得学习ing!
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马