Replace this program with:
ge = n % 10;
Shi =((n % 100)-ge)/ 10;
White = (n-(n%100))/100;
When calculating the high position, subtract the low position first.