Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isSumOfConsecutive2(n)
- x = 1
- y = 2
- z = 0
- number = 0
- while (x <= n)
- z = x + y
- while (y <= n)
- if z == n then
- number = number + 1
- end
- y = y + 1
- z = z + y
- end
- x = x + 1
- y = x + 1
- end
- return number
- end
Advertisement
Add Comment
Please, Sign In to add comment