namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
List<int> intList = new List<int> { 1, 2, 3, 4, 5, 6 };
IEnumerator enumerator = intList.GetEnumerator();
while (enumerator.MoveNext())
{
Console.WriteLine(enumerator.Current);
}
enumerator.Reset();
while (enumerator.MoveNext())
{
Console.WriteLine(enumerator.Current);
}
}
}
}
c# 迭代器
最新推荐文章于 2024-09-12 14:26:16 发布