索引超出数组界限 求解
namespace 直接插入排序{
class Program
{
static void Main(string[] args)
{
int[] org = new int[10];
int i, j ;
Console.Write("输入待排序元素:");
for ( i = 0; i < org.Length; i++)
{ org[i] =Convert.ToInt32( Console.ReadLine()); }
for( i=2;i<=org.Length;i++)
if (org[i]< org[i - 1])
{
int R = org[i];
for ( j = i - 1; org[j] > R; j--)
org[j + 1] = org[j];
org[j + 1] = R;
}
Console.WriteLine("-------输出结果---------");
for( i=0;i<ORG.LENGTH;I++)
{ Console.WriteLine( org[i]+"\t" )
;
}