using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job =new string [4]
job[0]="经理";
job[1]="项目主管";
job[2]="技术总监";
jib[3]="财务总管";
for (int i = 0; i <job.length; i++)
{
Console.Write(job[i]);//打印职位
}
}
}
}
string[] job =new string [4] 后面缺分号 ;
你的 job.length 其中的l是小写的应该改成job.Length ,跟我一样的问题
string[] job =new string [4] 后面应该加分号
jib[3]="财务总管"; 应该是job[3]
for (int i = 0; i <job.length; i++) length 首字母大写 Lenght
如果输出想换行就把Console.Write;换成Console.WriteLine;
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job = {"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印职位
}
}
}
}
没什么大问题,两个小问题
job写错
job.Length首字母大写
","是什么意思?
Console.Write(job[i]+","); 你没有加”,“那些职位就连起来了