Untitled
Anonymous
plain_text
11/07/2021 12:00 PM
696 B
27
Indexable
for(j = 1; j <= 7; j++)
{
random = rand() % 35 + 1;
while(lottoNumbs[j] == 0)
{
if(lottoNumbs.Contains(random) == false)
{
lottoNumbs[j] = random;
}
}
}
for(j = 1; j <= 7; j++)
{
random = rand() % 35 + 1;
while(lottoNumbs[j] == 0)
{
bool isUnique = true;
for(k = 1; k <= lottoNumbs.Length; k++)
{
if(lottoNumbs[k] == random)
{
isUnique = false;
break;
}
}
if(isUnique == true)
{
lottoNumbs[j] = random;
}
}
}Editor is loading...