Created
April 16, 2018 01:23
-
-
Save zabirauf/7adef6627e81124a66d9b4e670218edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
contract GlobalCalculator_V1 { | |
uint[] internal _nums; | |
function addNum(uint x) public { | |
_nums.push(x); | |
} | |
function getSum() public view returns (uint sum) { | |
for (uint i = 0; i < _nums.length; i++) { | |
sum += _nums[i]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment