*/
public class Work_T05 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个整数:");
int x = sc.nextInt();
// System.out.println(-x);
int count = countWeiShu(x);
System.out.println(x+"是"+count+"位数");
}
public static int countWeiShu(int a) {
int count = 0;
if (a < 0) {// 让负数变为正数
a = -a;
while (a % 10 > 0 || a / 10 != 0) {
a = a / 10;
count++;
}
}else {
while (a % 10 > 0 || a / 10 != 0) {
a = a / 10;
count++;
}
}
return count;
}