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