题解 | #提取不重复的整数#
#include<stdio.h>
int main(){
int x=0,shang[10]={0},yushu[10]={0},i,j,k,num=1;
scanf("%d",&x);
shang[0]=x;
yushu[0]=shang[0]%10;//个位
for(i=1;i<10;i++){
shang[i]=shang[i-1]/10;
yushu[i]=shang[i]%10;//个位,十位,百位,……
num++;
if(shang[i]<=0)
break;
else
continue;
}
printf("%d",yushu[0]);
for(k=1;k<num-1;k++)
{
for(j=0;j<k;j++)
{
if (yushu[k]!=yushu[j])
continue;
else
{
break;
}
}
if(j==k)
printf("%d",yushu[k]);
else
continue;
}
}