using System;
public class Sorteio
{
static Random _random = new Random();
public static void Shuffle<T>(T[] array)
{
var random = _random;
for (int i = array.Length; i > 1; i--)
{
int j = random.Next(i);
T tmp = array[j];
array[j] = array[i - 1];
array[i - 1] = tmp;
}
}
public static void Main()
{
string[] array = {
"José",
"Carlos",
"João",
"Miriam",
"Estela"
};
Shuffle(array);
foreach (string value in array)
{
Console.WriteLine(value);
}
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFNvcnRlaW8KewoJc3RhdGljIFJhbmRvbSBfcmFuZG9tID0gbmV3IFJhbmRvbSgpOwoKCXB1YmxpYyBzdGF0aWMgdm9pZCBTaHVmZmxlPFQ+KFRbXSBhcnJheSkKICAgIHsKCQl2YXIgcmFuZG9tID0gX3JhbmRvbTsKCQlmb3IgKGludCBpID0gYXJyYXkuTGVuZ3RoOyBpID4gMTsgaS0tKQoJCXsKCQkgICAgaW50IGogPSByYW5kb20uTmV4dChpKTsKCQkgICAgVCB0bXAgPSBhcnJheVtqXTsKCQkgICAgYXJyYXlbal0gPSBhcnJheVtpIC0gMV07CgkJICAgIGFycmF5W2kgLSAxXSA9IHRtcDsKCQl9CiAgICB9CgkgICAgCglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CiAgICAgICAgc3RyaW5nW10gYXJyYXkgPSB7IAogICAgICAgICAgIkpvc8OpIiwKICAgICAgICAgICJDYXJsb3MiLAogICAgICAgICAgIkpvw6NvIiwKICAgICAgICAgICJNaXJpYW0iLAogICAgICAgICAgIkVzdGVsYSIKICAgICAgICB9OwoJICAgIFNodWZmbGUoYXJyYXkpOwoJICAgIGZvcmVhY2ggKHN0cmluZyB2YWx1ZSBpbiBhcnJheSkKCSAgICB7CgkJICBDb25zb2xlLldyaXRlTGluZSh2YWx1ZSk7CgkgICAgfQkJCgl9Cn0=