在C#中控制台应用程序编写一个简单的数组怎么写?请解释一下

新手,很多都不明白,有专业的请帮我看一下代码,顺便写上一段在C#中windows应用程序中的数组,最好是详细一点,非常感谢! using System; using System.Collections.Generic; using System.Text; namespace 控制台应用程序 { class Program { static void Main(string[] args) { for (int i = 1; i < 10; i++) { Console.Read(i); } } } }

static void Main(string[] args) { int[] ary = { 1, 2, 3, 4, 5, 6 }; for (int i = 0; i < ary.Length; i++) { Console.WriteLine(ary[i]); } Console.ReadLine(); }
温馨提示:答案为网友推荐,仅供参考
相似回答