Unique Number 2

My code is working fine in Sublime text but not in CB IDE. Please look into it.