救命……一个蒟蒻做冒泡做炸了……
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n , tool;
scanf("%d" , &n);
int list[n];
for (int i = 0 ; i < n ; i++)
{
scanf("%d" , &list[i]);
}
for (int i = 0 ; i < n ; i++)
{
for (int z = 1 ; z < n - i ; z++)
{
if (list[i] < list[i-1])
{
tool = list[i];
list[i] = list[i-1];
list[i-1] = tool;
}
}
}
for (int i = 0 ; i < n ; i++)
{
printf("%d " , list[i]);
}
return 0;
}