代碼哪里有問題
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?string[] hero = new string[] {"關(guān)羽","張飛","趙云","馬超","黃忠"};//請(qǐng)?jiān)谶@里完善代碼
? ? ? ? ??
? ? ? ? ? ? ? ?for (int i = 0;i < hero.length;i++)
? ? ? ? ??
? ? ? ? ? ?{
? ? ? ? ? ? ? ?Console.Write(hero[i]+",");
? ? ? ? ? ?}
? ? ? ? }
? ? }
}
2018-09-29
Length這個(gè)大小寫弄錯(cuò)了,C#是嚴(yán)格區(qū)分大小寫的。
2018-08-27
for (int i = 0;i < hero.Length;i++) // 其中的hero.Length ?L為大寫
2018-08-10
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?string[] hero = new string[] {"關(guān)羽","張飛","趙云","馬超","黃忠"};//請(qǐng)?jiān)谶@里完善代碼
? ? ? ? ??
? ? ? ? ? ? ? ?for (int i = 0;i < 5;i++)
? ? ? ? ??
? ? ? ? ? ?{
? ? ? ? ? ? ? ?Console.Write(hero[i]+",");
? ? ? ? ? ?}
? ? ? ? }
? ? }
}