QQ群游僧提供!

十进制转二进制、八进制、十六进制,及其翻转。

            //Decimal to bin

            Console.WriteLine(Convert.ToString(100, 2));

            //Decimal to octal

            Console.WriteLine(Convert.ToString(100, 8));

            //Decimal to hexa

            Console.WriteLine(Convert.ToString(100, 16));

 

            //Bin to Dec

            Console.WriteLine(Convert.ToInt32("1100100", 2));

            //Oct to Dec

            Console.WriteLine(Convert.ToInt32("144", 8));

            //Hexa to Dec

            Console.WriteLine(Convert.ToInt32("64", 16));

 

输出结果如下:

1100100
144
64
100
100
100

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-05-16
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2021-04-21
  • 2021-08-04
  • 2022-01-27
  • 2021-06-21
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案