private void button2_Click(object sender, EventArgs e) { double a = 0; List<string> list = new List<string>(); for (int i = 0; i < 100; i++) { a += 0.1; list.Add(a.ToString("#0.0")); } List<int> list_int = new List<int>(); for (int i=0;i<list.Count;i++) { //var t = list[i]; //var t1 = Convert.ToInt32(t); //报错// 报错原因 var t1 = Convert.ToInt32("1.1"); // list_int.Add((int)Convert.ToDouble(list[i])); } var t1 = Convert.ToDouble("1.5"); var t2 = Convert.ToDouble("2.5"); var t3 = Convert.ToDouble("3.5"); var t = (int)(t1 + t2 + t3); var t0 = (int)t1 + (int)t2 + (int)t3; //1.5 2.5 3.5 //1...= 1+2+3 = 6; //2...=7.5 =7; } }