2025-02-20 19:29:03 +08:00

27 lines
412 B
C

#include <stdio.h>
int main(void){
int a;
scanf("%d", &a);
printf("该数的位数为%d\n",
(a/10==0?1:(a/100==0?2:(a/1000==0?3:(a/10000==0?4:5)))));
printf("%d", a%10);
if(a%100/10 != 0){
printf("%d", a%100/10);
}
if(a%1000/100 != 0){
printf("%d", a%1000/100);
}
if(a%10000/1000 != 0){
printf("%d", a%10000/1000);
}
if(a/10000 != 0){
printf("%d", a/10000);
}
printf("\n");
return 0;
}