&& 的邏輯

你的邏輯好嗎?
來寫個程式驗證&&的邏輯吧XDDD哈哈哈哈

#include <iostream>
#include <cstdlib> 
using  namespace std;
int main()
{
    bool x = 0;
    bool y = 0;
    cout << x << "&&" << y << "的結果是" << (x && y) <<endl;
    
    x = 0;
    y = 1;
    cout << x << "&&" << y << "的結果是" << (x && y) <<endl;
    
    x = 1;
    y = 0;
    cout << x << "&&" << y << "的結果是" << (x && y) <<endl;
    
    x = 1;
    y = 1;
    cout << x << "&&" << y << "的結果是" << (x && y) <<endl;
    
          
    system("pause");
    return 0;

}

留言