• 4月27日--28日课堂内容


    语句

    语句的分类

    * 一、顺序语句

    * 二、分支语句(选择语句)

    * 三、循环语句

    二、选择语句(分支语句/条件语句)  if  else

    1、定义

    if是如果的意思,else是另外的意思,if后面跟()括号内为判断条件,如果符合条件则进入if语句执行命令。如果不符合则不进入if语句。else后不用加条件,但是必须与if配合使用,else后也可加if,但if后需要条件。If-else可以嵌套。

    2、格式  

    (1)格式1

    if () //括号内是判断条件

    {

        //程序代码,运算等等

    }

    (2)格式2

    if (...)//括号内是判断条件

    {

        // 程序代码,运算等等

    }

    else //如果不满足条件则执行这里的代码

    {

       //程序代码,运算等等

    }

    (3)格式3

    if (...)//括号内是判断条件

    {

        // 程序代码,运算等等

    }

    else if (...)//另外如果满足条件2则执行以下的代码

    {

        //程序代码,运算等等

    }

    (4)格式4

    if (...)//如果满足条件1则执行这里的代码

    {

        // 程序代码,运算等等

    }

    if (...)//如果满足条件2则执行这里的代码

    {

        //程序代码,运算等等

    }

        ...

    else//最后不满足以上条件则执行这里的代码

    {

       //程序代码,运算等等

    }

    三、练习

    练习1:输入一个100以内的整数,判断是小于10的,还是两位,数还是100

         Console.Write("请输入一个100以内的整数:");            

         int a = int.Parse(Console.ReadLine());

         if (a <= 100)

         {

           if (a > 10&&a<100)

           {

             Console.WriteLine("您输入的是两位数");

           }

            else

            {

              if (a < 10)

              {

                Console.WriteLine("您输入的数小于10");

              }

               else 

               {

                 Console.WriteLine("您输入的是100");

               }

             }

          }

          else                   

          {

             Console.WriteLine("您输入的数大于100");                         

          }

         Console.ReadLine();

    练习2:输入分数判断是否及格,如果超过80分则输出 “你学的不错,值得表扬!”,如果在50—60分之间则输出“就差一点点,再加把劲”,如果小于50则输出“使劲努力,不要偷懒!”

    Console.Write("请输入您的分数:");

    double a = double.Parse(Console.ReadLine());

    if (a >= 0 && a <= 100)

    {

       Console.WriteLine("恭喜你,及格了!");

         if (a >= 80)

         {

            Console.WriteLine("你学的不错,值得表扬!");

         }

    }

    else if (a < 60 && a >= 50)

    {

       Console.WriteLine("就差一点点,再加把油!");

         if (a < 50 && a > 0)

         {

            Console.WriteLine("使劲努力,不要偷懒!");

          }

     }

    else

    {

       Console.WriteLine("请输入正确分数!");

    }

    Console.ReadLine();

    练习3:比较x、y、z的大小,并按照从大到小的顺序输出(没有写相等的情况)

    Console.Write("请输入第一个数字:");

    double x = double.Parse(Console.ReadLine());

    Console.Write("请输入第二个数字:");

    double y = double.Parse(Console.ReadLine());

    Console.Write("请输入第三个数字:");

    double z = double.Parse(Console.ReadLine());

    if (x > y && x > z)

    {

       if (y > z)

       {

           Console.WriteLine("三位数的排序为:x>y>z");

       }

       else

       {

           Console.WriteLine("三位数的排序为:x>z>y");

       }

    }

    else if (y > z && y > x)

    {

        if (z > x)

        {

            Console.WriteLine("三位数的排序为:y>z>x");

        }

        else

        {

            Console.WriteLine("三位数的排序为:y>x>z");

        }

    }

    else if (z > x && z > y)

    {

        if (x > y)

        {

            Console.WriteLine("三位数的排序为:z>x>y");

        }

        else

        {

            Console.WriteLine("三位数的排序为:z>y>x");

        }

     }

    else

    {

        Console.WriteLine("您的输入有误!");

    }

    Console.ReadLine();

    练习4:ax*x+bx+c=0判断方程是否是一元二次方程,和根的情况。根据公式判断方程的根的状况,公式的值大于零有两个根,等于零有一个根,小于零没有根。首先明白什么是一元二次方程,如果a等于0,方程式不是一元二次方程。

    用公式:代尔塔△=b2-4*a*c

    判断根的情况:△<0则方程无解,△=0方程有两个相等的实根,△>0方程有两个不同的实根求解则用到另一个公式:x=(-b±√b2-4*a*c)/(2*a),根号√需要用到函数 Math.Sqrt()

    Console.WriteLine("求方程式a*x2+b*x+c=0");

    Console.Write("请输入a=");

    double a = double.Parse(Console.ReadLine());            

    if (a == 0)

    {

        Console.WriteLine("次方程不是一元二次方程!");

    }

    else  //排除a=0的情况,剩下的a!=0的情况

    {

     //在a!=0的情况下就要判断derta的情况

         Console.Write("请输入b=");

         double b = double.Parse(Console.ReadLine());

         Console.Write("请输入c=");

         double c = double.Parse(Console.ReadLine());

         double de =b * b - 4 * a * c;

         if (de < 0)

         {

             Console.WriteLine("此方程无解!");

         }

         else   //排除de<0的情况,剩下的de>=0的情况

         {

             if (de > 0)

             {

                         Console.WriteLine("此方程有两个不同的实数根!");

                            double x1 = -b + Math.Sqrt(de);

                            double x2 = -b - Math.Sqrt(de);

              }

            else

            {

                Console.WriteLine("此方程有两个相同的实数根!");

                double x2 = -b - Math.Sqrt(de);  //因为两个实数根是相同的,所以+、-运算都可以

            }

        }

    }

    Console.ReadLine();

    练习5:相亲

    Console.WriteLine("相亲");

    Console.Write("请问您有房子吗:");

    string huida = Console.ReadLine();//在大环境定义了huida为字符串类型,在小环境中不可以改变huida的类型或重新定义,但可以重新定义新的字符串

    if (huida == "有")

    {

        Console.WriteLine("那咱们结婚吧!");

    }

    else  //没有房子的情况下

    {

        Console.Write("那你有钱吗:");

        string a = Console.ReadLine();//该句是重新定义a为字符串,也可用大环境的字符串huida=Console.ReadLine();但不可以改变或重新定义

        if (a == "有")

        {

            Console.WriteLine("那就先买房再结婚吧!");

        }

        else   //没有钱的情况下

        {

             Console.Write("那你有能力吗:");

             string b = Console.ReadLine();

             if (b == "有")

             {

                 Console.WriteLine("那就先赚钱再买房再结婚吧!");

             }

             else    //没有能力的情况下

             {

                 Console.WriteLine("对不起!拜拜!");

             }

         }

    }

    Console.ReadLine();

    四、Switch   case    break    default 练习

    //定义每个月的天数

    int m1 = 31, m2 = 28, m3 = 31, m4 = 30, m5 = 31, m6 = 30, m7 = 31, m8 = 31, m9 = 30, m10 = 31, m11 = 30;

    Console.Write("请输入月份:");

    int y = int.Parse(Console.ReadLine());

    if (y >= 1 && y <= 12)

    {

        Console.Write("请输入几号:");

        int h = int.Parse(Console.ReadLine());

        if (h >= 1 && h <= 31)

        {

            switch (y)

            {

                case 1:  //一月

                    Console.WriteLine("您输入的日期是第" + h.ToString() + "天"); //ToString意思是把点前面的转化为字符串类型

                    break;

                case 2:  //二月

                    Console.WriteLine("您输入的日期是第" + (m1 + h).ToString() + "天");

                    break;

                case 3:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + h).ToString() + "天");

                    break;

                case 4:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + h).ToString() + "天");

                    break;

                case 5:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + h).ToString() + "天");

                    break;

                case 6:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + h).ToString() + "天");

                    break;

                case 7:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + h).ToString() + "天");

                    break;

                case 8:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + m7 + h).ToString() + "天");

                    break;

                case 9:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + h).ToString() + "天");

                    break;

                case 10:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + h).ToString() + "天");

                    break;

                case 11:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + h).ToString() + "天");

                    break;

                case 12:

                    Console.WriteLine("您输入的日期是第" + (m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m9 + m10 + m11 + h).ToString() + "天");

                    break;

                default:

                    Console.WriteLine("您的输入有误!");

                    break;

           }

        }

        else

        {

            Console.WriteLine("您输入的日期有误!");

        }

    }

    else

    {

        Console.WriteLine("您输入的月份有误!");

    }

    Console.ReadLine();

    五、条件语句“日期”练习

    思维导图

                //分别输入年、月、日,判断格式是否正确

                //功能扩展:如果正确,输出此日期是当年的第几天

                //输入年份            

                Console.Write("请输入年份(0-9999):");

                int nf = int.Parse(Console.ReadLine());

                //判断年份输入是否正确

                if (nf >= 0 && nf <= 9999)

                {

                    //输入月份

                    Console.Write("请输入月份(1-12):");

                    int yf = int.Parse(Console.ReadLine());

                    //判断月份输入是否正确

                    if (yf >= 1 && yf <= 12)

                    {

                        //输入日期

                        Console.Write("请输入日期(1-31):");

                        int rq = int.Parse(Console.ReadLine());

                        //判断输入的月份是大月还是小月,去除2月

                        //如果,月份是大月那么填写的日期小于等于31,如果是小月那么日期小于等于30,

                        //如果是2月,判断是不是闰年

                        if (yf == 1 || yf == 3 || yf == 5 || yf == 7 || yf == 8 || yf == 10 || yf == 12)//此条件成立,说明是大月

                        {

                            if (rq >= 1 && rq <= 31)

                            {

                                Console.WriteLine("格式正确!");

                                Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                            }

                            else

                            {

                                Console.WriteLine("您的输入有误!");

                            }

                        }

                        else if (yf == 4 || yf == 6 || yf == 9 || yf == 11)//说明是小月

                        {

                            if (rq >= 1 && rq <= 30)

                            {

                                Console.WriteLine("日期输入正确!");

                                Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                            }

                            else

                            {

                                Console.WriteLine("您的输入有误!");

                            }

                        }

                        else if (yf == 2)//判断是不是闰年

                        {

                            //前一个公式判断正常年份是否是闰年,后一个公式判断整千年是否是闰年

                            if ((nf % 4 == 0 && nf % 100 != 0) || nf % 400 == 0)//符合此条件,说明是闰年

                                if (rq <= 29 && rq >= 1)

                                {

                                    Console.WriteLine("日期输入正确!");

                                    Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                    Console.WriteLine(nf + "年是闰年!");

                                }

                                else

                                {

                                    Console.WriteLine("您的输入有误!");

                                }

                            else//说明不是闰年

                            {

                                if (rq <= 28 && rq >= 1)

                                {

                                    Console.WriteLine("日期输入正确!");

                                    Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                    Console.WriteLine(nf + "年不是闰年!");

                                }

                                else

                                {

                                    Console.WriteLine("您的输入有误!");

                                }

                            }

                        }

                        else

                        {

                            Console.WriteLine("您输入的日期有误!");

                        }

                    }

                    else

                    {

                        Console.WriteLine("您输入的月份有误!");

                    }

                }

                else//年份输入错误

                {

                    Console.WriteLine("您输入的年份有误!");

                }

                Console.ReadLine();

    六、条件语句“日期”练习扩展练习

    //分别输入年、月、日,判断格式是否正确

                //功能扩展:如果正确,输出此日期是当年的第几天

                //输入年份            

                Console.Write("请输入年份(0-9999):");

                int nf = int.Parse(Console.ReadLine());

                bool ry = false;//bool判断是否是闰月,是true,不是false

                int yf1 = 31, yf2 = 28, yf3 = 31, yf4 = 30, yf5 = 31, yf6 = 30, yf7 = 31, yf8 = 31, yf9 = 30, yf10 = 31, yf11 = 30;

                int sum = 0;//合计,代表当前天数的总和,即第几天

                //判断年份输入是否正确

                if (nf >= 0 && nf <= 9999)

                {

                    //判断是否是闰年

                    if ((nf % 4 == 0 && nf % 100 != 0) || nf % 400 == 0)//符合,说明是闰年

                    {

                        ry = true;

                    }

                    else //不符合,说明不是闰年

                    {

                        ry = false;

                    }

                    //输入月份

                    Console.Write("请输入月份(1-12):");

                    int yf = int.Parse(Console.ReadLine());

                    //判断月份输入是否正确

                    if (yf >= 1 && yf <= 12)

                    {

                        //输入日期

                        Console.Write("请输入日期(1-31):");

                        int rq = int.Parse(Console.ReadLine());

                        //判断输入的月份是大月还是小月,去除2月

                        //如果,月份是大月那么填写的日期小于等于31,如果是小月那么日期小于等于30,

                        //如果是2月,判断是不是闰年

                        if (yf == 1 || yf == 3 || yf == 5 || yf == 7 || yf == 8 || yf == 10 || yf == 12)//此条件成立,说明是大月

                        {

                            if (rq >= 1 && rq <= 31)

                            {

                                Console.WriteLine("格式正确!");

                                Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                //计算当前日期是当年的第几天

                                if(ry)//表示ry=true,是闰年,后面的“=true”可以不写

                                {

                                    yf2=29;

                                    switch(yf)

                                    {

                                        case 1: sum=rq; break ;

                                        case 2: sum=yf1+rq; break ;

                                        case 3: sum=yf1+yf2+rq; break ;

                                        case 4: sum=yf1+yf2+yf3+rq; break ;

                                        case 5: sum=yf1+yf2+yf3+yf4+rq; break ;

                                        case 6: sum=yf1+yf2+yf3+yf4+yf5+rq; break ;

                                        case 7: sum=yf1+yf2+yf3+yf4+yf5+yf6+rq; break ;

                                        case 8: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+rq; break ;

                                        case 9: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+rq; break ;

                                        case 10: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+rq; break ;

                                        case 11: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+yf10+rq; break ;

                                        case 12: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+yf10+yf11+rq; break ;                                

                                    }

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                                else//不是闰年

                                {

                                    yf2=28;

                                    switch(yf)

                                    {

                                        case 1: sum=rq; break ;

                                        case 2: sum=yf1+rq; break ;

                                        case 3: sum=yf1+yf2+rq; break ;

                                        case 4: sum=yf1+yf2+yf3+rq; break ;

                                        case 5: sum=yf1+yf2+yf3+yf4+rq; break ;

                                        case 6: sum=yf1+yf2+yf3+yf4+yf5+rq; break ;

                                        case 7: sum=yf1+yf2+yf3+yf4+yf5+yf6+rq; break ;

                                        case 8: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+rq; break ;

                                        case 9: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+rq; break ;

                                        case 10: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+rq; break ;

                                        case 11: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+yf10+rq; break ;

                                        case 12: sum=yf1+yf2+yf3+yf4+yf5+yf6+yf7+yf8+yf9+yf10+yf11+rq; break ;                                

                                    }                                                              

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                            }

                            else

                            {

                                Console.WriteLine("您的输入有误!");

                            }

                        }

                        else if (yf == 4 || yf == 6 || yf == 9 || yf == 11)//说明是小月

                        {

                            if (rq >= 1 && rq <= 30)

                            {

                                Console.WriteLine("日期输入正确!");

                                Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                //计算当前日期是当年的第几天

                                if (ry)//表示ry=true,是闰年,后面的“=true”可以不写

                                {

                                    yf2 = 29;

                                    switch (yf)

                                    {

                                        case 1: sum = rq; break;

                                        case 2: sum = yf1 + rq; break;

                                        case 3: sum = yf1 + yf2 + rq; break;

                                        case 4: sum = yf1 + yf2 + yf3 + rq; break;

                                        case 5: sum = yf1 + yf2 + yf3 + yf4 + rq; break;

                                        case 6: sum = yf1 + yf2 + yf3 + yf4 + yf5 + rq; break;

                                        case 7: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + rq; break;

                                        case 8: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + rq; break;

                                        case 9: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + rq; break;

                                        case 10: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + rq; break;

                                        case 11: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + rq; break;

                                        case 12: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + yf11 + rq; break;

                                    }

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                                else//不是闰年

                                {

                                    yf2 = 28;

                                    switch (yf)

                                    {

                                        case 1: sum = rq; break;

                                        case 2: sum = yf1 + rq; break;

                                        case 3: sum = yf1 + yf2 + rq; break;

                                        case 4: sum = yf1 + yf2 + yf3 + rq; break;

                                        case 5: sum = yf1 + yf2 + yf3 + yf4 + rq; break;

                                        case 6: sum = yf1 + yf2 + yf3 + yf4 + yf5 + rq; break;

                                        case 7: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + rq; break;

                                        case 8: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + rq; break;

                                        case 9: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + rq; break;

                                        case 10: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + rq; break;

                                        case 11: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + rq; break;

                                        case 12: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + yf11 + rq; break;

                                    }

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                            }

                            else

                            {

                                Console.WriteLine("您的输入有误!");

                            }

                        }

                        else if (yf == 2)//判断是不是闰年

                        {

                            //前一个公式判断正常年份是否是闰年,后一个公式判断整千年是否是闰年

                            if ((nf % 4 == 0 && nf % 100 != 0) || nf % 400 == 0)//符合此条件,说明是闰年

                                if (rq <= 29 && rq >= 1)

                                {

                                    Console.WriteLine("日期输入正确!");

                                    Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                    Console.WriteLine(nf + "年是闰年!");

                                    yf2 = 29;

                                    switch (yf)

                                    {

                                        case 1: sum = rq; break;

                                        case 2: sum = yf1 + rq; break;

                                        case 3: sum = yf1 + yf2 + rq; break;

                                        case 4: sum = yf1 + yf2 + yf3 + rq; break;

                                        case 5: sum = yf1 + yf2 + yf3 + yf4 + rq; break;

                                        case 6: sum = yf1 + yf2 + yf3 + yf4 + yf5 + rq; break;

                                        case 7: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + rq; break;

                                        case 8: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + rq; break;

                                        case 9: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + rq; break;

                                        case 10: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + rq; break;

                                        case 11: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + rq; break;

                                        case 12: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + yf11 + rq; break;

                                    }

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                                else

                                {

                                    Console.WriteLine("您的输入有误!");

                                }

                            else//说明不是闰年

                            {

                                if (rq <= 28 && rq >= 1)

                                {

                                    Console.WriteLine("日期输入正确!");

                                    Console.WriteLine("您输入的日期是:" + nf + "年" + yf + "月" + rq + "日");

                                    Console.WriteLine(nf + "年不是闰年!");

                                    yf2 = 28;

                                    switch (yf)

                                    {

                                        case 1: sum = rq; break;

                                        case 2: sum = yf1 + rq; break;

                                        case 3: sum = yf1 + yf2 + rq; break;

                                        case 4: sum = yf1 + yf2 + yf3 + rq; break;

                                        case 5: sum = yf1 + yf2 + yf3 + yf4 + rq; break;

                                        case 6: sum = yf1 + yf2 + yf3 + yf4 + yf5 + rq; break;

                                        case 7: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + rq; break;

                                        case 8: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + rq; break;

                                        case 9: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + rq; break;

                                        case 10: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + rq; break;

                                        case 11: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + rq; break;

                                        case 12: sum = yf1 + yf2 + yf3 + yf4 + yf5 + yf6 + yf7 + yf8 + yf9 + yf10 + yf11 + rq; break;

                                    }

                                    Console.WriteLine(rq + "日是当年的第" + sum + "天");

                                }

                                else

                                {

                                    Console.WriteLine("您的输入有误!");

                                }

                            }

                        }

                        else

                        {

                            Console.WriteLine("您输入的日期有误!");

                        }

                    }

                    else

                    {

                        Console.WriteLine("您输入的月份有误!");

                    }

                }

                else//年份输入错误

                {

                    Console.WriteLine("您输入的年份有误!");

                }

                Console.ReadLine();

  • 相关阅读:
    CSharp Oracle 登陆
    Oracle基本流程语句
    数据库设计三大范式
    自己总结一些操作数据库的方法
    常用数据库取得前几行的方法
    Intellij idea创建javaWeb以及Servlet简单实现
    idea发布到tomcat缺少jar
    回调函数
    spring笔记
    动态代理
  • 原文地址:https://www.cnblogs.com/juyangchao12/p/5444893.html
Copyright © 2020-2023  润新知