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
期待明天 閱讀(1737)
評論(0) 編輯 收藏 所屬分類:
CSharp