标签:style color io os ar for 数据 div sp
1 10 20 40 32 67 40 20 89 300 400 15
8 15 20 32 40 67 89 300 400
#include<stdio.h> #include<algorithm> using namespace std; int main() { int t,a[110]; scanf("%d",&t); while(t--) { int n,i,k; scanf("%d",&n); for(i=0;i<n;++i) scanf("%d",&a[i]); sort(a,a+n); k=1; for(i=1;i<n;++i) { if(a[i]!=a[i-1]) k++; } printf("%d\n",k); printf("%d",a[0]); for(i=1;i<n;++i) { if(a[i]!=a[i-1]) printf(" %d",a[i]); } printf("\n"); } return 0; }
标签:style color io os ar for 数据 div sp
原文地址:http://blog.csdn.net/qq_18062811/article/details/39434999