Synchronization of old projects

Part1
This commit is contained in:
2025-09-30 16:46:01 +08:00
parent 116b65164b
commit 4e1548abe2
167 changed files with 8668 additions and 43 deletions
@@ -0,0 +1,53 @@
using System;
namespace Lesson19_循环语句for
{
class Program
{
static void Main(string[] args)
{
#region
//格式
//for (初始表达式; 条件表达式; 增量表达式)
//{
// //循环代码
//}
for (int i = 0; i < 10; i++)
{
Console.WriteLine("这时的i为{0}",i);
}
Console.WriteLine("\n换行\n");
#endregion
#region
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 5; j++)
{
Console.WriteLine("i的值为{0},j的值为{1}", i, j);
}
}
#endregion
#region
for (; ; )//空位可填可不填
{
Console.WriteLine("这是一个死循环");
break;//用break跳出死循环
}
#endregion
#region while循环
int j = 0;
while (j < 10)
{
Console.WriteLine("j为{0}",j);
}
j=0;//重置j
for (; j < 10; )//初始表达式和增量表达式可省略
{
Console.WriteLine("j为{0}", j);
}
#endregion
}
}
}