fork download
  1. #include<stdio.h>
  2. int main(){
  3. int b=0,n;
  4. scanf("%d",&n);
  5. if(n==0){
  6. printf("该数是1位数");
  7. return 0;
  8. }
  9. while(n!=0){
  10. n=n/10;
  11. b=b+1;
  12. }
  13. printf("该数是%d位数",b);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5320KB
stdin
143723
stdout
该数是6位数