一,看代码
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestNumber { class Program { static void Main(string[] args) { int i1 = 5 / 2; //2.5 int i2 = 11 / 2; //5.5 int i3 = 14 / 3; //4.6.... int i4 = Convert.ToInt32(5.5); int i5 = Convert.ToInt32(2.5); int i6 = Convert.ToInt32(2.6); Console.WriteLine(i1); Console.WriteLine(i2); Console.WriteLine(i3); Console.WriteLine(i4); Console.WriteLine(i5); Console.WriteLine(i6); Console.ReadKey(); } } }
二,输出