hdu 1040(本来想练个冒泡手速,竟然超时,果断sort。。。。) <pre name="code" class="cpp">#include <stdio.h> #include<algorithm> using namespace std; int str[1000],n; #define forxunhuan for(int i=0;i<n;i++) int main(){ int t; scanf("%d",&t); while(t--){ scanf("%d",&n); forxunhuan scanf("%d",&str[i]); sort(str,str+n); forxunhuan{ if(i) printf(" "); printf("%d",str[i]) ; } printf("\n"); } return 0; }
原文地址:http://blog.csdn.net/jibancanyang/article/details/42177075