Untitled

mail@pastecode.io avatar
unknown
csharp
23 days ago
462 B
9
Indexable
Never
Console.OutputEncoding = System.Text.Encoding.UTF8;

string[] Names = new string[]
{
            "Name1",
            "Name2",
 };

Random random = new Random();

string first = Names[random.Next(Names.Length)];
Console.WriteLine(first);

while (true)
{
    string second = Names[random.Next(Names.Length)];

    if (first != second)
    {
        Console.WriteLine(second);
        break;
    }
    else
    {
        continue;
    }
}
Leave a Comment