int[] score = new int[] {89,39,100,51,94,65,70 };//分数
Console.Write("不及格的有:");
for (int i = 0; i < score.Length ; i++)
{
if( score[i]<60 )//筛选条件
Console.Write(score[i]+",");
}
Console.Write("不及格的有:");
for (int i = 0; i < score.Length ; i++)
{
if( score[i]<60 )//筛选条件
Console.Write(score[i]+",");
}
2017-11-04
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job = new string[]{"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印职位
}
string[] job = new string[]{"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印职位
}
2017-11-01
string[] name ={"吴松","钱东宇","伏晨","陈好","周蕊","林日天","何昆","关欣欣"};
int[] mark ={89,85,98,56,60,91,93,85};
int max=0,k=0;//不知道为什么非要赋值才行
for(int i=0;i < mark.Length;i++)
{
if(mark[i]>max)
{
max = mark[i];
k = i;
}
}
Console.Write("分数最高的是{0},分数是{1}",name[k],mark[k]);
int[] mark ={89,85,98,56,60,91,93,85};
int max=0,k=0;//不知道为什么非要赋值才行
for(int i=0;i < mark.Length;i++)
{
if(mark[i]>max)
{
max = mark[i];
k = i;
}
}
Console.Write("分数最高的是{0},分数是{1}",name[k],mark[k]);
已采纳回答 / 慕粉9965376
{0}代表双引号后面的sum,意思是sum输出的位置在双引号中{0}对应的位置,如果要输出多个变量,就要插入多个{n},n数字递增,变量名放在双引号句子后面,用逗号相连,和n按顺序对应
2017-10-31