如何改写能够完成包含0和负数的排序
string sInput = txtInput.Text.Trim() + " ";
int j = 0;
int[] aInput = new int[10];
string temp = "0";
for (int i = 0; i <= sInput.Length - 1; i++)
{
if (sInput.Substring(i, 1) != " ")
{
temp += sInput.Substring(i, 1);
}
else
{
aInput[j] = int.Parse(temp);
j++;
temp = "0";
}
}
Array.Sort(aInput);
Array.Reverse(aInput);
foreach (int i in aInput)
{
if (i != 0)
{
Response.Write(i + " ");
}
}
}