第十一节课第一个作业

2018-12-06  本文已影响0人  起个名真难_9489


#代码

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

上一篇 下一篇

猜你喜欢

热点阅读