#include <random>
#include <stdint.h>
#include <algorithm>
using namespace std;
const int Count = 1000;
const int Space = 10;
vector<int16_t> vec, uniqueVec;
void generate()
{
mt19937 gen(0);
uniform_int_distribution<int16_t> dis(0, Space - 1);
for (int i = 0; i<Count; i++)
vec.push_back(dis(gen));
}
vector<int16_t> uniqueList(vector<int16_t> vec)
{
vector<int16_t> uniqueVec;
int16_t prev = 0;
for (int i = 0; i < vec.size(); i++)
{
if (i == 0 || vec[i] != prev)
{
prev = vec[i];
uniqueVec.push_back(vec[i]);
}
}
return uniqueVec;
}
void printUnique(vector<int16_t> uniqueVec)
{
for (int16_t n : uniqueVec)
printf("%d\n",n);
}
int main()
{
generate();
sort(vec.begin(), vec.end());
uniqueVec = uniqueList(vec);
printUnique(uniqueVec);
return 0;
}