这样表达更清楚
for (int i = 0; i < score.Length; i++)
{
if (score[i] < 60)
{
Console.WriteLine("有人不及格" + score[i]);
break;
}
Console.WriteLine(i);
for (int i = 0; i < score.Length; i++)
{
if (score[i] < 60)
{
Console.WriteLine("有人不及格" + score[i]);
break;
}
Console.WriteLine(i);
2017-05-08
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]);
2017-05-07
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]);//打印职位
}