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();
}
}
}
网友评论