#include<iostream>using namespace std;int main(){bool a;//宣告布林值(0或1)cin>>a;//輸入cout<<!a;//邏輯運算子"!"表示not,0變1,1變0}