设置一个标志位即可

#include<stdio.h>
int main() {
    int mark[10] = {0}, n;
    while (~scanf("%d", &n)) {
        while (n > 0) {
            if (mark[n % 10] == 0) {
                printf("%d", n % 10);
                mark[n % 10]++;
            }
            n /= 10;
        }
        printf("\n");
    }
}