我是stackowerflow的新手,也是可靠的新手。
我必须这样做:在函数booleanOperatorTest中,对变量foo求反,并将结果赋给变量negation
pragma solidity ^0.4.17;
contract OperatorTutorial {
function booleanOperatorTest(bool foo, bool bar) public pure
returns (bool negation, bool conjunction, bool disjunction, bool equality, bool inequality) {
// Negate the variable "foo" and assign the result to variable "negation"
// negation =
}我试了所有的方法,但我不能通过这一步,请帮助,谢谢。
发布于 2020-07-20 04:15:15
示例函数:
function booleanOperatorTest(bool foo, bool bar) public pure
returns (bool negation,bool conjunction) {
// Negate the variable "foo" and assign the result to variable "negation"
negation =foo;
conjunction = (foo && bar);
...
}发布于 2020-07-20 06:53:29
pragma solidity ^0.4.17;
contract OperatorTutorial {
function booleanOperatorTest(bool foo, bool bar) public pure
returns (bool negation, bool conjunction, bool disjunction, bool equality, bool inequality) {
negation = !foo;
}感谢Mert Sungur
发布于 2021-07-02 21:30:09
pragma solidity ^0.4.17;
contract OperatorTutorial {
function booleanOperatorTest(bool foo, bool bar) public pure
returns (bool negation, bool conjunction, bool disjunction, bool equality, bool inequality) {
// Negate the variable "foo" and assign the result to variable "negation"
// negation =
negation = !foo;
// Use logical "and" on variables "foo" and "bar" and assign the result to variable "conjunction"
// conjunction =
conjunction = (foo && bar);
// Use logical "or" on variables "foo" and "bar" and assign the result to variable "disjunction"
// disjunction =
disjunction = (foo || bar);
// Make sure variable "equality" is true when "foo" and "bar" are equal and is false otherwise.
// equality =
equality = (foo == bar);
// Make sure variable "inequality" is true when "foo" and "bar" are not equal and is false otherwise.
// inequality =
inequality = (foo != bar);
}https://stackoverflow.com/questions/62971049
复制相似问题