Guest User

Untitled

a guest
Apr 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. pragma solidity ^0.4.21;
  2.  
  3. contract GlobalCalculator_V1 {
  4. uint[] internal _nums;
  5.  
  6. function addNum(uint x) public {
  7. _nums.push(x);
  8. }
  9.  
  10. function getSum() public view returns (uint sum) {
  11. for (uint i = 0; i < _nums.length; i++) {
  12. sum += _nums[i];
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment