编辑代码

#include <stdio.h>
int main () 
{
    int x;
    scanf("%d",&x);
    if(x>0&&x<100000)
    {
     if(x>0&&x<10)
        {
            printf("它是一位数\n");
            printf("%d\n",x);
            printf("%d\n",x);
        }
     else if(x>=10&&x<100)
        {
            printf("它是两位数\n");
            printf("%d,%d\n",x/10,x%10);
            printf("%d%d\n",x%10,x/10);
        }
     else if(x>=100&&x<1000)
        {
            printf("它是三位数\n");
            printf("%d,%d,%d\n",x/100,x/10%10,x%10);
            printf("%d%d%d\n",x%10,x/10%10,x/100);
        }
     else if(x>=1000&&x<10000)
        {
            printf("它是四位数\n");
            printf("%d,%d,%d,%d\n",x/1000,x/100%10,x/10%10,x%10);
            printf("%d%d%d%d\n",x%10,x/10%10,x/100%10,x/1000);
        }
     else
        {
            printf("它是五位数\n");
            printf("%d,%d,%d,%d,%d\n",x/10000,x/1000%10,x/100%10,x/10%10,x%10);
            printf("%d%d%d%d%d\n",x%10,x/10%10,x/100%10,x/1000%10,x/10000);
        }  
    }
    else
      printf("请重新输入\n");
    
    return 0;
}