C#第十次作业2
完成以下要求:
{
try
{
double sum = 0;
Console.WriteLine("请输入本月会员消费金额");
double[] money = new double[5];
for (int i = 0; i <money.Length; i++)
{
Console.WriteLine("请输入第{0}款金额:", i + 1);
money[i] = Convert.ToInt32(Console.ReadLine());
sum = sum + money[i];
}
Console.WriteLine("序号 金额(元)");
for (int i = 0; i < money.Length; i++)
{
Console.WriteLine("{0} {1}", i + 1, money[i]);
if (i == money.Length - 1)
{
Console.WriteLine("总金额 {0} ", sum);
}
}
}catch
{
Console.WriteLine("你写你妈呢??");
}
Console.ReadKey();
}