#include <string>
#include <cstdio>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main(){
int n, x;
cin >> n;
set<int> st;
while(n--){
cin >> x;
int sum = 0;
do{
sum += x % 10;
x /= 10;
}while(x != 0);
st.insert(sum);
}
bool tag = false;
cout<<st.size()<<endl;
for(auto it: st){
if(!tag){
cout<<it;
tag = true;
}else cout<<" "<<it;
}
return 0;
}
1064 朋友数 (20 分)
最新推荐文章于 2022-11-10 23:51:59 发布