借放程式碼,這題應該沒什麼技術成分,用set解也可以
#include <bits/stdc++.h> //e465 f605
#define fast_as_a_fuckboy ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main(){
fast_as_a_fuckboy
int a[3];
for(int i = 0;i < 3;i++){
cin >> a[i];
}
sort(a, a+3);
reverse(a, a+3);
if(a[0] == a[1] && a[1] == a[2]){//全部一樣
cout << "3 " << a[0];
}
else if(a[0] == a[1]){
cout << "2 " << a[0] << " " << a[2];
}
else if(a[1] == a[2]){
cout << "2 " << a[0] << " " << a[2];
}
else{
cout << "1 " << a[0] << " " << a[1] << " " << a[2];
}
}