五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

C#編程-第二季-面向?qū)ο?宇宙最簡單2021最新版

2023-08-10 15:21 作者:霧隱半山  | 我要投稿

using System;


class MyList<T>

{

??private T[] items;

??private int count;


??public MyList()

??{

????items = new T[4];

????count = 0;

??}


??public int Capacity => items.Length;


??public int Count => count;


??public T this[int index]

??{

????get

????{

??????if (index < 0 || index >= count)

??????{

????????throw new IndexOutOfRangeException();

??????}

??????return items[index];

????}

????set

????{

??????if (index < 0 || index >= count)

??????{

????????throw new IndexOutOfRangeException();

??????}

??????items[index] = value;

????}

??}


??public void Add(T item)

??{

????if (count == items.Length)

????{

??????ResizeArray();

????}

????items[count] = item;

????count++;

??}


??public void Insert(int index, T item)

??{

????if (index < 0 || index > count)

????{

??????throw new IndexOutOfRangeException();

????}

????if (count == items.Length)

????{

??????ResizeArray();

????}

????for (int i = count; i > index; i--)

????{

??????items[i] = items[i - 1];

????}

????items[index] = item;

????count++;

??}


??public void RemoveAt(int index)

??{

????if (index < 0 || index >= count)

????{

??????throw new IndexOutOfRangeException();

????}

????for (int i = index; i < count - 1; i++)

????{

??????items[i] = items[i + 1];

????}

????count--;

????items[count] = default(T);

??}


??public int IndexOf(T item)

??{

????for (int i = 0; i < count; i++)

????{

??????if (items[i].Equals(item))

??????{

????????return i;

??????}

????}

????return -1;

??}


??public int LastIndexOf(T item)

??{

????for (int i = count - 1; i >= 0; i--)

????{

??????if (items[i].Equals(item))

??????{

????????return i;

??????}

????}

????return -1;

??}


??public void Sort()

??{

????Array.Sort(items, 0, count);

??}


??private void ResizeArray()

??{

????int newCapacity = items.Length * 2;

????T[] newArray = new T[newCapacity];

????Array.Copy(items, newArray, count);

????items = newArray;

??}

}


C#編程-第二季-面向?qū)ο?宇宙最簡單2021最新版的評論 (共 條)

分享到微博請遵守國家法律
怀安县| 安仁县| 额济纳旗| 抚州市| 岳普湖县| 荔浦县| 中牟县| 泸西县| 平山县| 高平市| 信宜市| 高清| 奉新县| 江都市| 门头沟区| 镇雄县| 达日县| 都兰县| 那坡县| 阿拉善右旗| 阿拉善左旗| 夏邑县| 清徐县| 清水河县| 门源| 库伦旗| 龙门县| 慈溪市| 潼南县| 中超| 武夷山市| 凤庆县| 泸水县| 化德县| 广灵县| 车险| 九台市| 新乡县| 雷州市| 麻栗坡县| 高雄县|