阿多 2023-10-24 208 0 0 0 0
c#数组的使用小例子

c#数组的使用小例子

using System;
class hello
{
  static void Main()
  {
     //int i;
      //i=1;
      //int[] arr=new int[] {1,2,3};<==>      int[] arr={1,2,3};

      int[] arr=new int[3];
      arr[0]=1;
      arr[1]=3;
      arr[2]=4;

      for (i=0; i<arr.Length; i++)
      {
         Console.WriteLine(arr[i]);   
      }

      foreach (int i in arr)
         Console.WriteLine(i);
  }
}

No Tags
相关内容
欢迎评论
未登录,
请先 [ 注册 ] or [ 登录 ]
(一分钟即可完成注册!)
返回首页     ·   返回[编程开发]   ·   返回顶部