int[] age =new int[4]; ;//声明并初始化长度为4的整形数组
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
}
//为数组元素赋值
age[0] = 18;
age[1] = 20;
age[2] = 23;
age[3] = 17;
Console.WriteLine("四名同学的年龄是:{0}、{1}、{2}、{3}",
age[0],age[1],age[2],age[3]);
}
2016-01-11
最新回答 / z嘘丶
因为C#还是靠自己动手操作更直观,第一章只是将基本背景和编译器操作介绍给你,之后还是要靠自己根据文本教学操作,这样印象更深。建议便做任务边在VS上延伸,如去掉某处一个字段结果会变成什么样子。加油,自学党们!一起努力!
2016-01-09
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
}
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
}
2016-01-08
{
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
}
}
在电脑VS2012上可以过,但在这上面,过不去啊。醉了
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <= y; x++)
{
Console.Write(x);
}
Console.WriteLine();//换行
}
}
}
}
在电脑VS2012上可以过,但在这上面,过不去啊。醉了
2016-01-08