HDU 1040 As Easy As A+B

#include <cstdio> 

#include <algorithm>

using namespace std;

int T,a[1005],n;

int main(){

    scanf("%d",&T);

    while(T--){

        scanf("%d",&n);

        for(int i=0;i<n;i++)scanf("%d",&a[i]); sort(a,a+n);

        for(int i=0;i<n-1;i++)printf("%d ",a[i]);

        printf("%d\n",a[n-1]);

    }return 0;

}

你可能感兴趣的:(HDU)