整理C# 二進制,十進制,十六進制 互轉
更新時間:2008年10月29日 15:33:35 作者:
c#下進制互轉代碼
//十進制轉二進制
Console.WriteLine(Convert.ToString(69, 2));
//十進制轉八進制
Console.WriteLine(Convert.ToString(69, 8));
//十進制轉十六進制
Console.WriteLine(Convert.ToString(69, 16));
//二進制轉十進制
Console.WriteLine(Convert.ToInt32(”100111101″, 2));
//八進制轉十進制
Console.WriteLine(Convert.ToInt32(”76″, 8));
//十六進制轉十進制
Console.WriteLine(Convert.ToInt32(”FF”, 16));
Console.WriteLine(Convert.ToString(69, 2));
//十進制轉八進制
Console.WriteLine(Convert.ToString(69, 8));
//十進制轉十六進制
Console.WriteLine(Convert.ToString(69, 16));
//二進制轉十進制
Console.WriteLine(Convert.ToInt32(”100111101″, 2));
//八進制轉十進制
Console.WriteLine(Convert.ToInt32(”76″, 8));
//十六進制轉十進制
Console.WriteLine(Convert.ToInt32(”FF”, 16));
相關文章
Unity通用泛型單例設計模式(普通型和繼承自MonoBehaviour)
這篇文章主要介紹了Unity通用泛型單例設計模式,分為普通型和繼承MonoBehaviour,幫助大家更好的理解和學習,感興趣的朋友可以了解下2020-07-07automation服務器不能創(chuàng)建對象 解決方法
本文主要介紹如何解決“automation服務器不能創(chuàng)建對象”錯誤,從而解決Visual Studio.Net不能正常使用的問題,需要的朋友可以參考下。2016-06-06CAD2008+VS2008開發(fā)ObjectARX加載失敗問題(推薦)
這篇文章主要介紹了CAD2008+VS2008開發(fā)ObjectARX加載失敗問題,本文通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-04-04C#中Write()和WriteLine()的區(qū)別分析
這篇文章主要介紹了C#中Write()和WriteLine()的區(qū)別分析,需要的朋友可以參考下2020-11-11