How to get the Nth digit of an integer with bit-wise operations?

后端 未结 12 1018
深忆病人
深忆病人 2021-01-30 21:23

Example. 123456, and we want the third from the right (\'4\') out.

The idea in practise is to access each digit seperately (ie. 6 5 4 3 2 1).

C/C++/C# preferred.

12条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 22:10

    two digit d1 and d2 will be passed .the program must print the nth Number is the number system that consist only digit with d1 and d2 input format first line contain d1 second line contain d2 third kine contain n d1 is not equal to d2

提交回复
热议问题