C#删除数组元素代码

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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[] { 1,3,5,7,9};
            
            for (int i=1;i<arr.Length-1;i++)
            {
            arr[i]=arr[i+1];
           
            }
            for (int j = 0; j < arr.Length - 1;j++ )
                Console.Write(arr[j] + " ");
                Console.ReadLine();
                
           
        }         
    }
}

  

posted on 2016-08-09 13:54  春暖花开28  阅读(5159)  评论(0)    收藏  举报

导航