C# 数组

发布时间:2020-06-26 11:22:59 作者:admin 阅读量:1217

using System;
namespace ArrayApplication
{
   class MyArray
   {
      static void Main(string[] args)
      {
         int []  n = new int[10]; /* n 是一个带有 10 个整数的数组 */
         int i,j;


         /* 初始化数组 n 中的元素 */        
         for ( i = 0; i < 10; i++ )
         {
            n[ i ] = i + 100;
         }

         /* 输出每个数组元素的值 */
         for (= 0; j < 10; j++ )
         {
            Console.WriteLine("Element[{0}] = {1}", j, n[j]);
         }
         Console.ReadKey();
      }
   }
}

上一篇:Json格式详解
下一篇:C# 运算符
© 2018-2014 版权所有:Lockbit.net

点击这里给我发消息

服务热线

13732484300

在线客服
  网站地图
浙ICP备18026806号-1
Catfish(鲶鱼) CMS V 6.7.3