# Arup Guha
# 12/8/2020
# Solution to COP 2930 Final Exam Part B Problem 1

def intcuberoot(n):

    # x is the value we are trying.
    x = 1

    # We keep on going as long as its cube is <= n, adding 1 each time.
    while x*x*x <= n:
        x += 1

    # We overshot so update res to be 1 less than x.
    return x-1

# Run some tests.
def main():
    print(intcuberoot(1))
    print(intcuberoot(2))
    print(intcuberoot(8))
    print(intcuberoot(26))
    print(intcuberoot(27))
    print(intcuberoot(123454321))

main()

