using System.Collections;
internal class Program
{
internal class MyEnumerator : IEnumerator
{
private Arr arr;
public MyEnumerator(Arr arr)
{
this.arr = arr;
}
public object Current => throw new NotImplementedException();
public bool MoveNext()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
class Arr : IEnumerable
{
public IEnumerator GetEnumerator()
{
return new MyEnumerator(this);
}
}
private static void Main(string[] args)
{
int[] ar = new int[] { 5, 4, 3, 2 };
IEnumerable<int> ie = ar;
foreach (int i in ie)
Console.WriteLine(i);
}
}