五月天青色头像情侣网名,国产亚洲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最新版的評論 (共 條)

分享到微博請遵守國家法律
宁津县| 杭州市| 台东市| 冀州市| 临清市| 江源县| 尉犁县| 布拖县| 自贡市| 尉氏县| 克什克腾旗| 杂多县| 陆河县| 肇州县| 呼玛县| 溧水县| 扶余县| 皋兰县| 思茅市| 新田县| 沽源县| 陆河县| 白水县| 乐平市| 海宁市| 太仆寺旗| 苍溪县| 梅河口市| 陵川县| 洪江市| 根河市| 苍山县| 扎囊县| 铁岭市| 曲阜市| 鄂尔多斯市| 阜阳市| 延庆县| 运城市| 南汇区| 彭山县|