在这里,为了实现代码的高效性,若在||的左边已经判断为true,这时候就不用在判断||的右边,最终都是true。同理,如果已经判断&&的左边为false,后面就不用判断了,结果为false
//懂的自然懂
//懂的自然懂
2018-01-09
string[] name = {"景珍", ...};
int[] score = {90,...};
double seq = 0;
string pass = null;
foreach (int x in score)
{
seq = x + seq;
}
seq = seq/score.Length;
for (int i=0;i<score.Length;i++)
if (score[i]>seq)
{
pass=pass+name[i]+" ";
}
Console.WriteLine("平均分是"+ seq +",高于平均分的有:");
Console.Write(pass);
int[] score = {90,...};
double seq = 0;
string pass = null;
foreach (int x in score)
{
seq = x + seq;
}
seq = seq/score.Length;
for (int i=0;i<score.Length;i++)
if (score[i]>seq)
{
pass=pass+name[i]+" ";
}
Console.WriteLine("平均分是"+ seq +",高于平均分的有:");
Console.Write(pass);
已采纳回答 / qq_光辉de岁月_0
int x =1while(true)//条件一直成立,一直循环{ x++; if (x>10) //需加入条件判断,中止循环 break;}
2018-01-08
Console.WriteLine((score>95)?"奖励一辆自行车":"");
2018-01-04