c++ implementation 

Something is wrong dont know what