隨筆 - 78  文章 - 25  trackbacks - 0
          <2009年10月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿

          隨筆分類(75)

          隨筆檔案(78)

          相冊

          實用Links

          我的Links

          搜索

          •  

          積分與排名

          • 積分 - 114328
          • 排名 - 515

          最新評論

          閱讀排行榜

          評論排行榜

          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 期待明天 閱讀(1738) 評論(0)  編輯  收藏 所屬分類: CSharp
          主站蜘蛛池模板: 天峨县| 玉田县| 六枝特区| 会同县| 岑溪市| 石狮市| 延川县| 开鲁县| 襄城县| 察隅县| 缙云县| 五莲县| 高密市| 思南县| 永川市| 堆龙德庆县| 抚顺县| 新野县| 佳木斯市| 郑州市| 白山市| 嘉峪关市| 新源县| 水富县| 台前县| 沁源县| 隆德县| 汕尾市| 鹤壁市| 珲春市| 德昌县| 延吉市| 河南省| 荥经县| 望奎县| 济阳县| 绵竹市| 卓尼县| 南开区| 阳城县| 大同市|