如何在C#中使用for循环遍历数组?
for循环是一个非常流行且有用的循环结构。
namespace demo_array { class Program { static void Main(string[] args) { int[] array = { 100, 300, 500, 700, 900, 1000 }; //Use for loop. for (int i = 0; i < array.Length; i++) { Console.WriteLine(array[i]); } Console.ReadKey(); } } }
日期:2020-04-11 22:50:30 来源:oir作者:oir