题目
廉价商品
代码
try
{
string[] shangping = new string[5];
for (int i = 0; i < shangping.Length; i++)
{
Console.WriteLine("请输入第{0}个特价商品的名称", i + 1);
shangping[i] = Console.ReadLine();
}
Console.WriteLine("本次特价商品是:");
foreach (var item in shangping)
{
Console.WriteLine(item);
}
}
catch
{
Console.WriteLine("你输入的有误");
}
Console.ReadKey();
网友评论