Check whether a number is perfect

+30
CPP
cpp
OUTPUT