C#语言-编写一个控制台应用程序,可根据输入的月份判断所在季节

/*编写一个控制台应用程序,可根据输入的月份判断所在季节*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _20153236_sy1_2
{
    class Program
    {
        static void Main(string[] args)
        {
            int i;
            Console.WriteLine("***********欢迎进入季节判断系统(气象划分法)***************");
            while (true)
            {
                Console.WriteLine("菜单:");
                Console.WriteLine("           1.1月    2.2月    3.3月           ");
                Console.WriteLine("           4.4月    5.5月    6.6月           ");
                Console.WriteLine("           7.7月    8.8月    9.9月           ");
                Console.WriteLine("           10.10月  11.11月  12.12月         ");
                Console.WriteLine("           13.退出                           ");
                Console.WriteLine("请输入月份序号:");
                i = int.Parse(Console.ReadLine());
                switch (i)
                {
                    case 3:
                    case 4:
                    case 5: Console.WriteLine("此月份在春季。。。"); break;
                    case 6:
                    case 7:
                    case 8: Console.WriteLine("此月份在夏季。。。"); break;
                    case 9:
                    case 10:
                    case 11: Console.WriteLine("此月份在秋季。。。"); break;
                    case 12:
                    case 1:
                    case 2: Console.WriteLine("此月份在冬季。。。"); break;
                    case 13: Console.WriteLine("退出成功,再见!!!"); break;
                    default: Console.WriteLine("输入错误!!!"); break;
                }//switch结束
                if (i == 13) break; //退出系统
            }//while结束
        }
    }

}

运行结果截图:

转载请注明出处,并附有原文链接,谢谢!如有侵权,请及时联系。

 

  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lady_killer9

感谢您的打赏,我会加倍努力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值