#include <stdio.h> int main () { int x,n=1; printf("输入一串数字:"); scanf("%d",&x); x/=10; while(x>0) { n++; x/=10; } printf("这串数字长度为:%d",n); return 0; }