using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
int[] nums = new int[4];
int money = 0;
Console.WriteLine("请输入4家店的价格");
for (int i = 0; i <nums.Length; i++)
{
Console.Write("第{0}店的价格:", i + 1);
nums[i] = Convert.ToInt32(Console.ReadLine());
}
for (int i = 0; i <nums.Length - 1; i++)
{
if (nums[i] < nums[i + 1])
{
money =nums[i];
nums[i +1] =nums[i];
}
else
{
money = nums[i + 1];
}
}
Console.WriteLine("最低价格是:{0}", money);
}
catch
{
Console.WriteLine("你输入的格式有误");
}
Console.ReadKey();
}
}
}