Код 1:
Код: Выделить всё
int i = 0;
int j = 0;
while (i < 10)
{
Console.WriteLine("Sublist");
while (j < 3)
{
Console.WriteLine($"Entry: {j}");
j++;
}
i++;
}
Код 2:
Код: Выделить всё
int i = 0;
while (i < 10)
{
int j = 0;
Console.WriteLine("Sublist");
while (j < 3)
{
Console.WriteLine($"Entry: {j}");
j++;
}
i++;
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... -and-scope
Мобильная версия