gpt4 book ai didi

java - 找不到符号变量

转载 作者:行者123 更新时间:2023-11-29 03:35:06 25 4
gpt4 key购买 nike

<分区>

错误是“找不到符号变量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);

}

}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com