#include <stdio.h>
#include <stdlib.h>
int main()
{
int digit_seen[10] = {0}, a[10] = {0};
int digit, b = 0;
long int n;
printf("请输入数字:");
scanf("%ld", &n);
while(n > 0)
{
digit = n % 10;
if(digit_seen[digit] >= 1)
{
a[digit] =a[digit] + 1;
b = 1;
//printf("a[%d]:%d\n",digit,a[digit]);
}
else
{
digit_seen[digit] = 1;
//printf("digit_seen[%d]:%d\n",digit,digit_seen[digit]);
}
n /= 10;
}
if(b == 1)
{
printf("有重复数字:");
int i;
for(i = 0; i <= 9; i++)
{
if(a[i] == 1)
{
printf("%d ",i);
}
}
}
else
{
printf("没有重复数字\n");
}
return 0;
}