美文网首页
2018-12-06

2018-12-06

作者: 追魂_409e | 来源:发表于2018-12-13 09:34 被阅读0次

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

    class Program

    {

        static void Main(string[] args)

        {

            try

            {

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

                int[] money = new int[4];

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

                {

                    Console.WriteLine("请输入第{0}店的价格:", n + 1);

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

                }

                int a = 10000000;

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

                {

                    if(money[i]<a)

                    {

                        a = money[i];

                    }

                }

            }

            catch

            {

                Console.WriteLine("你输入的格式错误");

            }

            Console.ReadKey();

        }

    }

}

相关文章

网友评论

      本文标题:2018-12-06

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