Sunday, September 7, 2014

COJ 1189. Skew Binary

It is guaranteed that the number will fit in 32 bit integer, the rest is easy,we need to input the number as a string, then from right to left loop over it and every time multiply the current digit with it's appropriate power of 2 minus 1.


       FULL SOURCE CODE

No comments:

Post a Comment