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();
        }
    }
}

 

posted @ 2016-01-17 15:46  _Nestling  阅读(134)  评论(0编辑  收藏  举报