• C#学习二


    1. 编写一个控制台应用程序,可根据输入的月份判断所在季节。
    2. using System;

      using System.Collections.Generic;

      using System.Linq;

      using System.Text;

      namespace 实验一

      {

          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结束

              }

          }

      }

  • 相关阅读:
    Ubuntu “Failed to fetch”错误的解决方法
    #ifndef 与#pragma once
    vs TODO list使用
    window脚本编写bat程序执行
    vtk 的qt插件编译
    git bash 下载加速
    条件欧几里得聚类 pcl::ConditionalEuclideanClustering
    ANY数据类型的使用
    《C#编程风格》还记得多少
    驼峰命名法则
  • 原文地址:https://www.cnblogs.com/D10304/p/15664612.html
Copyright © 2020-2023  润新知