在我自己的VS中运行没有错啊,怎么在这里就有问题昵?
static void Main(string[] args)
{
int[] num = new int[] { 3,34,42,2,11,19,30,55,20};
for(int x=0;x<num.Length;x++)
{
if(num[x]%2==0)
Console.Write(num[x]+".");
}
}
static void Main(string[] args)
{
int[] num = new int[] { 3,34,42,2,11,19,30,55,20};
for(int x=0;x<num.Length;x++)
{
if(num[x]%2==0)
Console.Write(num[x]+".");
}
}
string [] names =new string[5];
for (int i=0;i<names.Length;i++)
{
names[0]=" 关羽";
names[1]=" 张飞";
names[2]=" 赵云";
names[3]=" 马超";
names[4]=" 黄忠";
Console.WriteLine(names[i]);
for (int i=0;i<names.Length;i++)
{
names[0]=" 关羽";
names[1]=" 张飞";
names[2]=" 赵云";
names[3]=" 马超";
names[4]=" 黄忠";
Console.WriteLine(names[i]);
string[] names = new string[] { "关羽", "张飞", "赵云", "马超", "黄忠" };//请在这里完善代码
for (int i = 0; i < names.Length; i++)
{
Console.Write(names[i] + "");
}
for (int i = 0; i < names.Length; i++)
{
Console.Write(names[i] + "");
}
string[] job = { "经理", "项目主管", "技术总监", "财务主管" };
for (int i = 0; i < job.Length; i++)
{
Console.WriteLine(job[i]);//打印职位
}
这哪错了,,,,,,,,,啊啊啊啊啊啊
for (int i = 0; i < job.Length; i++)
{
Console.WriteLine(job[i]);//打印职位
}
这哪错了,,,,,,,,,啊啊啊啊啊啊
2015-12-15
最赞回答 / Perona
{0}是占位符。占位符,用{ }来表示,在{ }内填写所占的位的序号,C#规定从0开始。如在这行语句中输出变量age和name,那就要多再写个占位符,如:<...code...>
2015-12-13
int max = 0; string[,] i = new string [8,2] { { "吴松", "89" }, { "钱东宇", "90" }, { "伏晨", "98" },等等。。。};for (int j = 0; j < 8; j++){if (Convert.ToInt32( i[max, 1])< Convert.ToInt32( i[j, 1]))max = j;}Console.WriteLine("分数最高的是{0},分数是{1} \n请按任意键继续。。。",i[max,0],i[max,1]);Console.ReadKey();