using System;
class Demo
{
public static void Main()
{
int factor = 2;
Func<int,int> multiplicador = delegate (int n) { return n * factor;};
factor = 10;
// Usa el valor actualizado de la variable `factor`:
Console.WriteLine (multiplicador(3));
}
}
dXNpbmcgU3lzdGVtOwoKY2xhc3MgRGVtbwp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7CiAgICAgICAgaW50IGZhY3RvciA9IDI7CgogICAgICAgIEZ1bmM8aW50LGludD4gbXVsdGlwbGljYWRvciA9IGRlbGVnYXRlIChpbnQgbikgeyByZXR1cm4gbiAqIGZhY3Rvcjt9OwoKICAgICAgICBmYWN0b3IgPSAxMDsKCiAgICAgICAgLy8gVXNhIGVsIHZhbG9yIGFjdHVhbGl6YWRvIGRlIGxhIHZhcmlhYmxlIGBmYWN0b3JgOgogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lIChtdWx0aXBsaWNhZG9yKDMpKTsKICAgIH0KfQ==