美文网首页
第12节课第一个作业

第12节课第一个作业

作者: Deku啊 | 来源:发表于2018-12-06 09:24 被阅读0次

    #作业目标:

    ##编码:

    try{Console.WriteLine("请输入要四家店的价格");

                int[] money=new int[4];

                //输入四家店的价格

                for (int i = 0; i < money.Length; i++)

                { Console.WriteLine("第{0}店的价格:",i+1);

                money[i] = Convert.ToInt32(Console.ReadLine());

                }

                //排序

                Array.Sort(money);    //排列升序

                //显示最小值

                    Console.Write("最低价格是:{0}",money[0]);

                }

                catch { Console.WriteLine("输入格式有误"); }

                Console.ReadKey();

    ###实际效果:

    相关文章

      网友评论

          本文标题:第12节课第一个作业

          本文链接:https://www.haomeiwen.com/subject/sikncqtx.html