当前位置:首页 > 未命名 > 正文

2.16 逻辑变量

#include <iostream>
using namespace std;

int main()
{
    bool light = false;
    light = !light;
    light = !light;
    light = !light;
    light = !light;
    light = !light;
    if(light)
        cout << "灯亮";
    else
        cout << "灯灭";
    return 0; 
}

更新时间 2024-12-26