问答详情
源自:5-3 编程练习

哪错了呢?

string[] kk={"关羽","张飞","赵云","马超","黄忠"};//请在这里完善代码 

for (int i=0;i<kk.length;i++) 

        { 

        Console.Write(kk[i]+","); 

        } 

提问者:yunyun_126 2015-09-14 10:09

个回答

  • 渣渣健
    2016-02-05 15:52:59

    for (int i=0;i<kk.length;i++)   应该改成 for (int i=0;i<kk.Length;i++)

    这里的Length 要大写

  • 藏玉岩
    2016-01-01 21:12:01

    没错的。你用自己软件编译运行就知道,系统问题别介意

  • YouMuse
    2015-09-14 11:17:16

    string str = k[i];

    此行代码,多写的!

  • YouMuse
    2015-09-14 11:15:19

                string[] k = { "关羽", "张飞", "赵云", "马超", "黄忠" };
                for (int i = 0; i < k.LongLength; i++)
                {
                    string str = k[i];
                    Console.Write(k[i] + " ");
                }
                Console.ReadKey();