solidity基础-循环

循环代码

contract LoopTest {

    uint256 public counter;

    function loopTest(uint n) public {

        for(uint i=0; i<n; i++){
           counter += 1;
        }
    }  
}

输出

  

 

posted @ 2022-05-05 08:59  apeNote  阅读(62)  评论(0编辑  收藏  举报