主页
C++
C++ 嵌套 If
demo_if_nested
运行 ❯
×
更改方向
保存代码
更改主题
#include
using namespace std; int main() { int x = 15; int y = 25; if (x > 10) { cout << "x is greater than 10\n"; // Nested if if (y > 20) { cout << "y is also greater than 20\n"; } } return 0; }
x is greater than 10
y is also greater than 20