#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int>year(n);
for (int i = 0; i < n; i++)
{
cin >> year[i];
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (year[i] < year[j])
{
int temp1 = year[i];
year[i] = year[j];
year[j] = temp1;
}
}
}
int x = 0;
vector<int>day;
for (int i = 0; i < n; i++)
{
if (year[i] == year[i + 1])
{
x += 1;
}
else
{
day.push_back(year[i]);
}
}
int len = day.size();
cout << len << endl;
for (int i = 0; i < len; i++)
{
cout << day[i]<<" ";
}
return 0;
}
c++明明的随机数
最新推荐文章于 2024-09-19 22:20:36 发布