using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ArrayOperation
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = { 123,12,245,1,2,45,67};//一维数组,类型为int
            int[,] b = { {12,34,1,7},{23,345,12,45}};//二维数组,类型为int
            string[] c = { "hello","World","你好"};//一维数组,类型为string
            foreach (int i in a) {//输出a数组
                System.Console.Write("{0}  ",i);
            }
            System.Console.WriteLine();//换行
            foreach (int j in b){//输出b数组
                System.Console.Write("{0}  ", j);
            }
            System.Console.WriteLine();//换行
            foreach (string j in c){//输出c数组
                System.Console.Write("{0}  ", j);
            }
            System.Console.ReadLine();//方便看结果,免得结果一闪而过
        }
    }
}
	posted on 2009-10-25 16:22 
期待明天 阅读(1747) 
评论(0)  编辑  收藏  所属分类: 
CSharp