本文整理汇总了C#中System.Int32.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Int32.CopyTo方法的具体用法?C# Int32.CopyTo怎么用?C# Int32.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Int32
的用法示例。
在下文中一共展示了Int32.CopyTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Transaction t1 = new Transaction("001", "8/10/2012", 78900.00);
Transaction t2 = new Transaction("002", "9/10/2012", 451900.00);
t1.showTransaction();
t2.showTransaction();
Console.ReadKey();
Int32[] arrInt = new Int32[] { 7, 6, 9, 65, 8, 3, 5, 4 };
Int32[] arrIntCopy = new Int32[arrInt.Length];
//arrInt.CopyTo(arrIntCopy, 0);
ArraySelection<Int32> arrIntSel = new ArraySelection<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntSel.ElementsCollection = arrIntCopy;
arrIntSel.Sort();
Console.Write("array selection sort:\n");
for (int i = 0; i < arrIntSel.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntSel.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayInsert<Int32> arrIntIns = new ArrayInsert<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntIns.ElementsCollection = arrIntCopy;
arrIntIns.Sort();
Console.Write("array Insert sort:\n");
for (int i = 0; i < arrIntIns.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntIns.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayBubble<Int32> arrIntBub = new ArrayBubble<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntBub.ElementsCollection = arrIntCopy;
arrIntBub.Sort();
Console.Write("array Buble sort:\n");
for (int i = 0; i < arrIntBub.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntBub.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayShell<Int32> arrIntShe = new ArrayShell<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntShe.ElementsCollection = arrIntCopy;
arrIntShe.Sort();
Console.Write("array Shell sort:\n");
for (int i = 0; i < arrIntShe.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntShe.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayMerge<Int32> arrIntMer = new ArrayMerge<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntMer.ElementsCollection = arrIntCopy;
arrIntMer.Sort();
Console.Write("array Merge sort:\n");
for (int i = 0; i < arrIntMer.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntMer.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayQuick<Int32> arrIntQui = new ArrayQuick<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntQui.ElementsCollection = arrIntCopy;
arrIntQui.Sort();
Console.Write("array Quick sort:\n");
for (int i = 0; i < arrIntQui.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntQui.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
ArrayHeap<Int32> arrIntHea = new ArrayHeap<Int32>();
arrInt.CopyTo(arrIntCopy, 0);
arrIntHea.ElementsCollection = arrIntCopy;
arrIntHea.Sort();
Console.Write("array Heap sort:\n");
for (int i = 0; i < arrIntHea.ElementsCollection.Length; ++i)
{
Console.Write("{0} ", arrIntHea.ElementsCollection.GetValue(i).ToString());
}
Console.WriteLine();
Console.ReadKey();
}