using System;
public class Frase
{
string[] palabras = "GitHub Gist permite crear fragmentos de código de forma eficiente.".Split();
public string this [int indicePalabra] // indizador
{
get
{
return palabras[indicePalabra];
}
set
{
palabras[indicePalabra] = value;
}
}
public static void Main()
{
Frase f = new Frase();
Console.WriteLine (f[1]); // Gist
f[9] = "rápida";
Console.WriteLine (f[9]); // rápida
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIEZyYXNlCnsKCXN0cmluZ1tdIHBhbGFicmFzID0gIkdpdEh1YiBHaXN0IHBlcm1pdGUgY3JlYXIgZnJhZ21lbnRvcyBkZSBjw7NkaWdvIGRlIGZvcm1hIGVmaWNpZW50ZS4iLlNwbGl0KCk7CgkKCXB1YmxpYyBzdHJpbmcgdGhpcyBbaW50IGluZGljZVBhbGFicmFdCQkvLyBpbmRpemFkb3IKCXsKCQlnZXQKCQl7CgkJCXJldHVybiBwYWxhYnJhc1tpbmRpY2VQYWxhYnJhXTsKCQl9CgkJc2V0CgkJewoJCQlwYWxhYnJhc1tpbmRpY2VQYWxhYnJhXSA9IHZhbHVlOwoJCX0KCX0KCQoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCUZyYXNlIGYgPSBuZXcgRnJhc2UoKTsKCQlDb25zb2xlLldyaXRlTGluZSAoZlsxXSk7CQkvLyBHaXN0CgkJZls5XSA9ICJyw6FwaWRhIjsKCQlDb25zb2xlLldyaXRlTGluZSAoZls5XSk7CQkvLyByw6FwaWRhCgl9Cn0=