char s[10], t[10];
void convert(char *strSource, char *strTarget, int nLen)
{
    int i, j;
    char strConvert[10];
    if(nLen == 1) {
        strTarget[0] = strSource[0];
        printf("%s\n", t);
        return;
    }
    else {
        for(i=0; i<nLen; i++) {
            for(j=0; j<i && strSource[i] != strSource[j]; j++);
            if(j == i) {
                strTarget[0] = strSource[i];
                memcpy(strConvert, strSource, i);
                memcpy(strConvert+i, strSource+i+1, nLen-i-1);
                convert(strConvert, strTarget+1, nLen-1);
            }
        }
    }
}
main()
{
    int n;
    scanf("%d", &n);
    sprintf(s, "%d", n);
    memset(t, 0, 10);
    convert(s, t, strlen(s));
}
据说这个重复情况挺多。