ms1995 2012-07-19 00:12:00
点我顶贴
收藏
删除
之前WA死我了啊。。总算AC一次。
贴上代码
#include<iostream>
#include "string.h"
using namespace std;
bool N[1001];
int main()
{
memset(N, 0, sizeof(N));
int n, x, c=0;
cin >> n;
for (int ct=0; ct!=n; ++ct)
{
cin >> x;
if (!N[x])
++c;
N[x]=true;
}
cout << c << endl;
for (int ct=1; ct!=1001; ++ct)
{
if (N[ct])
cout << ct << " ";
}
return 0;
}