for (int i = 0; i < 5; i++)//唯美精简风格
{
Console.WriteLine(i);
}
//变形成以下简约风格
int i = 0;
for (; i < 5; )
{
Console.WriteLine(i);
i++;
}
//把上面的for改成while再去掉括号里的;
int i = 0;
while ( i < 5 )
{
Console.WriteLine(i);
i++;
}
//终极变形,应该是最原始的朴素形态
int i = 0;
for (;;)
{
if (i < 5)
{
Console.WriteLine(i);
i++;
continue;
}
else
{
break;
}
}
楼下兄弟接着变