W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
using System; namespace MyApplication { class Program { static void Main(string[] args) { int myInt = 10; double myDouble = 5.25; bool myBool = true; Console.WriteLine(Convert.ToString(myInt)); // 将 int 转换为 string Console.WriteLine(Convert.ToDouble(myInt)); // 将 int 转换为 double Console.WriteLine(Convert.ToInt32(myDouble)); // 将 double 转换为 int Console.WriteLine(Convert.ToString(myBool)); // 将 bool 转换为 string } } }