2018-12-06

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

        }

    }

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • using System; using System.Collections.Generic; using Sys...
    追魂_409e阅读 903评论 0 0
  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 1,547评论 0 0
  • 作业1需求image.png try { double[] price = new d...
    晨颜阅读 1,267评论 0 0
  • 知识点: 注:int类型默认32位有大小范围 且第一位为符号位 0 为正 1 为负 8.4作业 A:1、风力预警系...
    cGunsNRoses阅读 4,750评论 0 0
  • 文/剪甯 目 录 | 【历史仙侠】《仙旅三国》简介&目录 上一章 | 【历史仙侠】仙旅三国 (59) 下一章 ...
    剪甯阅读 6,616评论 57 51