主页
C++
C++ Else If语句
demo_if_else_if
运行 ❯
×
更改方向
保存代码
更改主题
#include
using namespace std; int main() { int time = 22; if (time < 10) { cout << "Good morning."; } else if (time < 20) { cout << "Good day."; } else { cout << "Good evening."; } return 0; }
Good evening.