string[] job = new string[4] job[0] ="经理"; job[1]= "项目主管"; job[2]= "技术总监"; job[3]= "财务主管" for (int i = 0; i <job.length; i++) 这点还是没弄懂,如果这样写可以吗
告诉你们把,这是系统问题,string[] job = new string[]{"经理项目主管技术总监财务主管"};非要这么写才可以,好坑的,之前的也有,非要连在一起不分开,正确答案在自己软件上运行可以就好了,至于这里填的怎么过怎么填
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job = new string[] { "经理","项目主管","技术总监","财务主管"};
for (int i = 0; i <4 ; i++)
{
Console.WriteLine(job[i]);//打印职位
}
}
}
}
//定义一个大小为4的字符串数组
string[] job = new string[4];
//对字符串数组进行赋值
job[0] ="经理";
job[1]= "项目主管";
job[2]= "技术总监";
job[3]= "财务主管";
//遍历数组
for (int i = 0; i < job.Length; i++) {
Console.WriteLine("第{0}位是{1}", i, job[i]);
}注意语法,还有一句写完要写分号,多看看语法基础