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

常用链接

留言簿

随笔分类(75)

随笔档案(78)

相册

实用Links

我的Links

搜索

  •  

积分与排名

  • 积分 - 111811
  • 排名 - 519

最新评论

阅读排行榜

评论排行榜

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 期待明天 阅读(1707) 评论(0)  编辑  收藏 所属分类: CSharp

只有注册用户登录后才能发表评论。


网站导航: