讨论 / 题解 23行代码
liyangjida 2018-06-15 16:16:47
点我顶贴 收藏 删除
#include<algorithm>

#include<iostream>

using namespace std;

int N;

int arry[100];

int main()

{

cin >> N;

for (int i = 0; i < N; ++i)

{

cin >> arry[i];

}

sort(arry, arry + N);

int *end = unique(arry, arry + N);

cout << static_cast<int>(end - arry) << endl;

for (int *p = arry; p != end; ++p)

{

cout << *p << " ";

}

cout << endl;

return 0;

}

#1 Ndddd@2018-06-16 10:39:20
回复 删除
[][][][]
#2 Ndddd@2018-06-16 10:39:27
回复 删除
NddddNdddd
#3 Ndddd@2018-06-16 10:39:31
回复 删除
NddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNddddNdddd
#4 Neptune1@2018-07-03 21:54:27
回复 删除
辣鸡
#5 TanGentLine@2018-07-13 14:50:58
回复 删除
指针方法 赞!

查看更多回复
提交回复