多个if 是平级
if 后面添加else if 是前面不满足if条件,则后面else if 判断
举例:
int score=Convert.ToInt32(Console.ReadLine());
if (socre >=90)
{
Console.WriteLine("成绩是A");
}else if (socre >=70)
{
Console.WriteLine("成绩是A");
}
前面判断scroe>=90显示A,如果不满足>=90则向下条件判断是否满足>=70;以此类推
这个就是else if的逻辑