📅  最后修改于: 2022-03-11 14:49:01.539000             🧑  作者: Mango
List list = new List { 1, 2, 3, 4, 5 };
//For Loop
for (int i = 0; i < list.Count(); i++)
{ Console.WriteLine(list[i]); }
//For Each Loop
foreach (int item in list)
{ Console.WriteLine(item); }