try
{
double[] money = new double[5];
Console.WriteLine("请输入会员本月的消费记录");
for (int i = 0; i < money.Length; i++)
{
Console.Write("请输入第{0}个笔购物金额:",i+1);
money[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("\n");
Console.WriteLine("序号\t\t金额(元)");
double sum = 0;
for (int i = 0; i < money.Length; i++)
{
Console.WriteLine("{0}\t\t{1}",i + 1,money[1]);
sum += money[i];
}
Console.WriteLine("总金额\t\t{0}", sum);
}
catch
{
Console.WriteLine("您输入的程序错误");
}
Console.ReadKey();