解釋下while之后的語句是什么意思
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
if(num>=0&&num<=999999999){
??? while(num!=0){
??????? count++;
??????? num/=10;
??? }
??? System.out.println("它是個"+count+"位的數(shù)!");
}else{
??? System.out.println("輸入有誤!");
}
2016-11-06
while之后是條件語句,如果num不等于0,則執(zhí)行大括號里的語句。
2016-11-06
num = num / 10;
2016-11-06
如果num不等于0;這個數(shù) 的位數(shù)就加一