using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Array intArray = Array.CreateInstance(typeof(int), 5);//Array.CreateInstance创建类型为int,长度为5的数组
for (int i = 0; i < 5; i++) {
intArray.SetValue(15, i);//像数组intArray[i]赋值
}
for (int i = 0; i < 5; i++) {
Console.WriteLine(intArray.GetValue(i));//获取元素intArray[i]的值并输出
}
Console.ReadLine();
}
}
}

相关文章:

  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-05-20
  • 2021-12-30
猜你喜欢
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
相关资源
相似解决方案