为了账号安全,请及时绑定邮箱和手机立即绑定

代码哪里有问题

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]+",");

           }

        }

    }

}


正在回答

3 回答

Length这个大小写弄错了,C#是严格区分大小写的。

0 回复 有任何疑惑可以回复我~
#1

慕运维0412251

那些词要用大写,那些小写?
2018-11-27 回复 有任何疑惑可以回复我~

for (int i = 0;i < hero.Length;i++) // 其中的hero.Length  L为大写

0 回复 有任何疑惑可以回复我~

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]+",");

           }

        }

    }

}


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
C#开发轻松入门
  • 参与学习       251726    人
  • 解答问题       1448    个

本门课程是C#语言的入门教程,将带你轻松入门.NET开发

进入课程

代码哪里有问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信