本帖最后由 张建康 于 2012-3-2 19:25 编辑
int [] count = { 83, 60, 38, 22, 64, 76, 23, 22, 75, 85, 34, };
int counta=0;
for (int i = 0; i < count.Length - 1; i++)
{
for (int j = 0; j < count.Length - 1-i; j++)
{
if (count[j] < count[j + 1])
{
int temp=count[j];
count[j]=count[j+1];
count[j + 1] = temp;
}
}
}
for (int i = 0; i < count.Length; i++)
{
counta += count;
}
Console.WriteLine(counta);
Console.ReadKey();
最后输出的结果是数组的和,但想得到的结果是:在一行里从大到小的顺序排列。怎么把int 数组转换为string阿? |