Private static IEnumerable<T> FunDemo(T para)
{
while(...)
{
....
yield return Obj;
}
}
static main(arg[] arg)
{
IEnumerable<T> list=FunDemo(para);
foreach(var m in list)
{
Console.WriteLine("The No. "+IndexOf(m));
do{
Console.WriteLine(....);
}while(...)
}
}