using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] hero = new string[] {"关羽","张飞","赵云","马超","黄忠"};//请在这里完善代码
for (int i = 0;i < hero.length;i++)
{
Console.Write(hero[i]+",");
}
}
}
}
Length这个大小写弄错了,C#是严格区分大小写的。
for (int i = 0;i < hero.Length;i++) // 其中的hero.Length L为大写
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string[] hero = new string[] {"关羽","张飞","赵云","马超","黄忠"};//请在这里完善代码
for (int i = 0;i < 5;i++)
{
Console.Write(hero[i]+",");
}
}
}
}