using System;
Iterator? it = new Iterator();
while (it.Value.MoveNext())
{
Console.WriteLine(it.Value.Current);
}
public struct Iterator
{
public int Current;
public bool MoveNext()
{
Current++;
return Current < 10;
}
}
이 코드가 어떤 결과를 출력할까요? 관련된 문제를 이해한 분을 제외하고 대부분 1 ~ 9
의 출력을 기대합니다.
다음은 OREN EINI의 답입니다.