一、初始化
1.数组
① 一维数组
#region 数组定义和赋值
string[] file_path = new string[10];
for(int i=0;i<file_path.length;i++)
{
file_path[i]=Console.ReadLine();
}
#endregion
二、函数
1. 循环
① foreach
#region 方法一:foreach
int[] a= { 1, 2, 3, 4, 5, 6 };
foreach (int b in a)
{
Console.WriteLine(b);
}
#endregion
② while
#region 方法二:while
int i=0;
int[] a = { 1, 2, 3, 4, 5, 6 };
while( i<a.Length)
{
Console.WriteLine(a[i]);
i++;
}
#endregion
③ for
#region 方法三:for
int[] a = { 1, 2, 3, 4, 5, 6 };
for (int i = 0; i < score.Length ; i++)
{
Console.WriteLine(a[i]);
}
#endregion