using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
var items = new List<Action>();
int i = 0;
while (i < 3){
items.Add(() => Console.WriteLine(i));
i++;
}
foreach (var item in items){
item();