int[] iArrary = new int[] { 1, 5, 13, 6, 10, 55, 99, 2, 87, 12, 34, 75, 33, 47 };
for (int i = 0; i < iArrary.Length; i++)
{
for (int j =i+1; j < iArrary.Length; j++)
{
if (iArrary[i]>iArrary[j])
{
int temp = iArrary[i];
iArrary[i]=iArrary[j];
iArrary[j] = temp;
}
}
}
string str = "";
for (int z = 0; z < iArrary.Length; z++)
{
str += iArrary[z].ToString() + ",";
}
你的輸出代碼呢?
Console.WriteLine(str);
加在最後看看。
希望采納我的回答。