foreach的用法
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { double[,] hillHeight = {{1,2,3,4},{2,3,4,5},{3,4,5,6}}; foreach (double height in hillHeight) { Console.WriteLine("{0}",height); } Console.ReadKey(); } } }