错误是“找不到符号变量b ” 我也想了解如何正确编写do while 循环的语法 谢谢。
import java.util.*;
public class pract3ex10 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
do {
System.out.println("Enter a positive");
int n = s.nextInt();
int x = n;
int m = 0;
if (x < 0) {
System.out.println("Thank You!");
} else {
while (x > 0) {
x = x / 10;
m++;
}
System.out.println("Number of digits in " + n + "= " + m);
}
} while (n > 0);
}
}