#include
#include
using?namespace?std;
int?main()? {
int?n;
cin?>>?n;
int?*p?=?new?int[n];
for?(int?i?=?0;?i?
p[i]?=?rand()?%?6?+?1 ;
for?(int?i?=?0;?i?
for?(int?j?=?i;? j?
if?(p[j]?<=?p[i])
swap(p[i],?p[j ]);
cout?<
}
delete[]?p;
return?0;
}
OK, you can also use other methods to sort that section.