# include<stdio.h>
# include<stdlib.h>
int main(){
int number[10],len=3,counter=0;
for(int i=0;i<len;i++){
scanf("%d",&number[i]);
}
if(number[0]==number[1]){ //通靈最多出現次數
if(number[1]==number[2]) counter=3;
else counter=2;
}else if(number[0]==number[2]){
counter=2;
}else if(number[1]==number[2]) counter=2;
else counter=1;
for(int i=0;i<len;i++){ //去重
for(int j = i+1; j < len; j++){
if(number[i] == number[j]){
for(int k = j; k <len; k++){
number[k] = number[k+1];
}
j--;
len--;
}
}
}
if(len==2){ //排序
if(number[0]<number[1]){
int temp=number[0];
number[0]=number[1];
number[1]=temp;
}
}else {
for(int j=0;j<3;j++){
for(int i=len-1;i>0;i--){ //小弟只知道這種爛寫法 希望有人能提出更好排序
if(number[i]>number[i-1]){
int temp=number[i];
number[i]=number[i-1];
number[i-1]=temp;
}
}
}
}
printf("%d ",counter);
for(int i=0;i<len;i++){
printf("%d ",number[i]);
}
return 0;
}
# include
# include
int main(){
int number[3],len=3,counter=0;
for(int i=0;i
scanf("%d",&number[i]);
}
if(number[0]==number[1]){ //通靈最多出現次數
if(number[1]==number[2]) counter=3;
else counter=2;
}else if(number[0]==number[2]){
counter=2;
}else if(number[1]==number[2]) counter=2;
else counter=1;for(int i=0;i