static void Main(string[] args)
{
int[] score = { 85,76,98,100,62,60};//分数
bool hasNopass = false;//记录是否有不及格的,默认没有
for (int i = 0; i < score.Length; i++)
{
if (score[i] < 60)//如果有不及格的
{
hasNopass=true;//记录有不及格的
}
}
if (hasNopass==true)
Console.WriteLine("有人不及格");
else
Console.WriteLine("都及格啦!");
}
{
int[] score = { 85,76,98,100,62,60};//分数
bool hasNopass = false;//记录是否有不及格的,默认没有
for (int i = 0; i < score.Length; i++)
{
if (score[i] < 60)//如果有不及格的
{
hasNopass=true;//记录有不及格的
}
}
if (hasNopass==true)
Console.WriteLine("有人不及格");
else
Console.WriteLine("都及格啦!");
}
2016-08-29
static void Main(string[] args)
{
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]+",");
}
}
{
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]+",");
}
}
2016-08-29
static void Main(string[] args)
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[]job=new string[]{"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i <4; i++)
{
Console.Write(job[i]);//打印职位
}
} 记得换行是个梗
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[]job=new string[]{"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i <4; i++)
{
Console.Write(job[i]);//打印职位
}
} 记得换行是个梗
2016-08-29
int x = 1;
do
{
x++;
Console.Write(x+" ");
}
while(x>1&&x<=4);
do
{
x++;
Console.Write(x+" ");
}
while(x>1&&x<=4);
2016-08-28