C# 控制台应用小程序(二)1+2+3+…+4+100
代码
#region 1+2+3+...+100
int a = 0;
for (int b = 1; b < 101; b++)
{
a = a + b;
}
Console.WriteLine("{0}", a);
#endregion
#region 1+2+3+...+100
int a = 0;
for (int b = 1; b < 101; b++)
{
a = a + b;
}
Console.WriteLine("{0}", a);
#endregion