美文网首页
2018-12-06

2018-12-06

作者: 一只皮皮橙 | 来源:发表于2018-12-06 18:45 被阅读0次

    try

                {

                    int[] money = new int[4];

                    Console.WriteLine("请输入4家店的价格");

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

                    {

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

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

                    }

                    Array.Sort(money);

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

                }

                catch

                {

                    Console.WriteLine("你输入的程序错误");

                }

                Console.ReadKey();

    相关文章

      网友评论

          本文标题:2018-12-06

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