第12节课第一个作业

2018-12-06  本文已影响0人  Deku啊

#作业目标:

##编码:

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();

###实际效果:

上一篇下一篇

猜你喜欢

热点阅读