#include<stdio.h>
int main()
{
int Out[100];
int n, a, sum, ans;
for (int i = 0; i < 100; i++)
{
Out[i] = -1;
}
scanf("%d", &n);
ans = 0;
while (n--)
{
scanf("%d", &a);
sum = 0;
while (a)
{
sum += (a % 10);
a /= 10;
}
if (Out[sum] == -1)
{
Out[sum] = 1;
ans++;
}
}
printf("%d\n", ans);
int flag = 0;
for (int i = 0; i < 100; i++)
{
if (Out[i] == 1)
{
if (flag == 0)
{
printf("%d", i);
flag = 1;
}
else
printf(" %d", i);
}
}
system("pause");
return 0;
}
1064
最新推荐文章于 2023-12-21 19:43:52 发布