标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 46831 Accepted Submission(s):
20046
1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> //sort函数的头文件 4 using namespace std; 5 int main() 6 { 7 int n, m, i, a[10000], j, t; 8 scanf("%d",&n); 9 while(n--) 10 { 11 scanf("%d",&m); 12 for(i=1; i<=m; i++) 13 scanf("%d",&a[i]); 14 sort(a+1,a+1+m); //sort排序 15 for(i=1; i<=m; i++) 16 { 17 printf("%d",a[i]); 18 if(i!=m) //注意输出格式,最后一个数不输出空格,直接换行 19 printf(" "); 20 else 21 printf("\n"); 22 } 23 } 24 return 0; 25 26 27 }
标签:
原文地址:http://www.cnblogs.com/pshw/p/4812540.html