大一新人 最近在自学c语言
有没有人能帮忙看看到底是什么问题
是不是关于else的连用的问题?
已经没有问题了。你第二张图和第一张图不一样吧。
第一张能运行,第二张不能运行
#include<iostream>
using namespace std;
int main()
{
int age;
scanf_s("%d", &age);
if (age < 30)
{
printf("你还是个少年:");
}
else if (age >= 30 && age <= 50)
{
printf("你已步入青年:");
}
else if (age > 50)
{
printf("你已经老二了");
}
return 0;
}
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/299623905956145.png "#left")