課程
/后端開發(fā)
/Java
/Java入門第一季(IDEA工具)
怎么做???
2017-03-02
源自:Java入門第一季(IDEA工具) 4-15
正在回答
public class HelloWorld {?? ?public static void main(String[] agr) {?? ??? ?int count = 0;?? ??? ?Scanner scan = new Scanner(System.in);?? ??? ?System.out.println("請輸入你要判斷的那個數(shù):");?? ??? ?int num = scan.nextInt();?? ??? ?while(num!=0)?? ??? ?{?? ??? ???? num=num/10;?? ??? ???? count++;?? ??? ??? ??? ??? ??? ??? ??? ?}?? ??? ?System.out.println("你輸入的那個數(shù)是:"+count+"位數(shù)");?? ?}}
int x = 999;
if(x > 100) {
System.out.print("它是個3位的數(shù)");
}
舉報
0基礎(chǔ)萌新入門第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語法開始
2 回答輸入999,則輸出 “它是個3位的數(shù)!”
3 回答輸入999,則輸出“它是個3位數(shù)!”
3 回答判斷一個數(shù)(小于10位)的位數(shù)。 輸入999,則輸出 “它是個3位的數(shù)!”
2 回答判斷一個數(shù)(小于10位)的位數(shù)。 輸入999,則輸出 “它是個3位的數(shù)!”
2 回答判斷一個數(shù)(小于10位)的位數(shù)。 輸入999,則輸出 “它是個3位的數(shù)!
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-03-02
public class HelloWorld {
?? ?public static void main(String[] agr) {
?? ??? ?int count = 0;
?? ??? ?Scanner scan = new Scanner(System.in);
?? ??? ?System.out.println("請輸入你要判斷的那個數(shù):");
?? ??? ?int num = scan.nextInt();
?? ??? ?while(num!=0)
?? ??? ?{
?? ??? ???? num=num/10;
?? ??? ???? count++;
?? ??? ??? ?
?? ??? ??? ?
?? ??? ?}
?? ??? ?System.out.println("你輸入的那個數(shù)是:"+count+"位數(shù)");
?? ?}
}
2017-03-02
int x = 999;
if(x > 100) {
System.out.print("它是個3位的數(shù)");
}