Description
输入N个数字,将这N个数字去重后按照从小到大的顺序输出。
Input
输入包含多组测试数据。
对于每组测试数据,第一行是一个正整数N(1<=N<=10000),第二行是N个非负整数,每个整数均在int范围内。
Output
对于每组测试数据,输出包含两行,第一行是去重后的数字个数,第二行是这些数字。
Samples
input Copy
6
1 2 2 3 4 4
8
8 7 6 5 4 3 2 1
output Copy
4
1 2 3 4
8
1 2 3 4 5 6 7 8
#include <stdio.h>
#include <map>
#include <iostream>
using namespace std;
map<int,int>mp;
map<int,int>::iterator it;
int main()
{
int n,m;
while(scanf("%d",&n)!=EOF)
{
for(int i=0;i<n;++i)
{
scanf("%d",&m);