解析 如满意请记得采纳,不懂请追问#include int main(void){\x09int num;\x09int count = 0;\x09printf("请输入一个数:");\x09scanf("%d", &num);\x09while (0 != num)\x09{\x09\x09num /= 10;\x09\x09count++;\x09}\x09...结果一 题目 C语言中用switch语句怎么判断一个数是几位数 答案 ...
int main(void){ int num;int count = 0;printf("请输入一个数:");scanf("%d", &num);while (0 != num){ num /= 10;count++;} switch (count){ case 1: printf("是一位数\n"); break;case 2: printf("是两位数\n"); break;case 3: printf("是三位数\n"); break;case ...
printf("%d是一个%d位数\n",x,(int)(log10(x)+1));return 0;}