using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
Console.WriteLine("请输入会员的消费记录");
double[] money = new double[5];
for (int n = 0; n < money.Length; n++)
{
Console.WriteLine("请输入会员第{0}笔购物金额:", n + 1);
money[n]=Convert.ToDouble(Console.ReadLine());
}
double sum = 0;
Console.WriteLine("序号\t\t金额(元)");
for (int i = 0; i < money.Length;i++ )
{
Console.WriteLine("{0}\t\t{1}", i+1,sum);
sum +=money [i];
}
Console.WriteLine("总金额\t\t{0}",sum);
}
catch
{
Console.WriteLine("你输入的格式错误");
}
Console.ReadKey();
}
}
}