这是问题所在:
编写一个名为 TipsList 的程序,它接受七个双精度值,代表服务员在一周中每天赚取的小费。显示每个值以及指示它与平均值相差多远的消息。
这是我到目前为止所知道的。
static void Main(string[] args)
{
double[] tips;
tips = new double[7];
double one = tips[0];
double two = tips[1];
double three = tips[2];
double four = tips[3];
double five = tips[4];
double six = tips[5];
double seven = tips[6];
double average = (one + two + three + four + five + six + seven) / 7;
//Now I am trying to take the tip 1,2,3,4,5,6, and 7 that the user has entered
//And display the diffrence of tip 1,2,3,4,5,6, and 7 from the average
//So one-average = tip 1 console.Write tip1 ??????
for (int i = 0; i <= 6; i++)
{
Console.Write("Please enter the amount of tips earned by waiter #" + i + ".");
tips[i] = Console.Read();
Console.Write("tips 1????????????HELP");
}
}
}
我了解我将如何尝试并认为我应该这样做
one-average = tip 1 console.Write tip1
???
但 C# 不喜欢它。我只是不明白它仍然 C# 只让我以一种确定的方式去做。