为什么num>0和num>1都是可以的
public class fortest{
public static void main(String[] args) {
int num = 999;
int count = 0;
do {
count++;
num = num / 10;
}
while (num>1);
System.out.print("这个数是" + count + "位数");
}
}
public class fortest{
public static void main(String[] args) {
int num = 999;
int count = 0;
do {
count++;
num = num / 10;
}
while (num>1);
System.out.print("这个数是" + count + "位数");
}
}
2017-08-17
举报