ethereum(以太坊)(五)--Bool

Posted on 2018-11-13 17:33  eilinge  阅读(163)  评论(0编辑  收藏  举报
pragma solidity ^0.4.0;

contract Bool{
    uint num1 = 100;
    uint num2 = 200;
    bool _c = true;
    
    // && ==
    function yuf() constant returns(bool){
        return num1 == num2 && _c; //false
    }
    
    // || !=
    function huof() constant returns(bool){
        return num1 != num2 || _c; //true
    }
}