1
已解决
题目描述 Description
某次考试后,胡老师不小心将已经排好顺序的试卷打乱了,不过由于试卷的数量很大,实际上只有很少的试卷顺序是错误的,请你选择合适的排序方法,帮助胡老师完成从小到大的排序过程。
输入描述 Input Description
第一行,一个正整数n(1≤n≤2,500,000)
第二行,n个正整数,数值在1到100之间
输出描述 Output Description
一行,从小到大排序完成的结果
样例输入 Sample Input
5
3 2 1 5 4
样例输出 Sample Output
1 2 3 4 5
80! 找错!
#include<bits/stdc++.h>
using namespace std;
int a[25000010];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;++i)
cin>>a[i];
sort(a,a+n);
for(int i=0;i<n;++i)
cout<<a[i]<<" ";
return 0;
}
求大佬指点!!
谢谢!!
