020.运算符-逻辑运算符-非

#include <iostream>
using namespace std;
int main()
{
    //逻辑运算符!非,真变假,假变真
    int a = 10;
    cout << !a << endl;//在c++中,除了0都为真
    cout << !!a << endl;
    system("pause");
    return 0;
}

 

posted @ 2021-09-03 17:54  梦之心  阅读(51)  评论(0编辑  收藏  举报