第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

代碼錯(cuò)誤4

int one = 10 ;
??????? int two = 20 ;
??????? int three = 0 ;
??????? three=one+two;
??????? three+=one;
??????? three-=one;
??????? three*=one;
??????? three/=one;
??????? three%=one;
??????? System.out.println("three=one+two==>"+three);
??????? System.out.println("three+=one==>"+three);
??????? System.out.println("three-=one==>"+three);
??????? System.out.println("three*=oneo==>"+three);
??????? System.out.println("three/=one==>"+three);
??????? System.out.println("three%=one==>"+three);


? 輸出不對(duì)? 都是0

正在回答

4 回答

http://img1.sycdn.imooc.com//59021c670001b13206640404.jpg

重新實(shí)驗(yàn)的結(jié)果

0 回復(fù) 有任何疑惑可以回復(fù)我~

? ?int one = 10 ;

? ? ? ? int two = 20 ;

? ? ? ? int three = 0 ;

? ? System.out.println(three=one+two);

? ? System.out.println(three+=one); ? ?

? ? System.out.println(three-=one); ? ?

? ? System.out.println(three*=one); ? ?

? ? System.out.println(three/=one); ? ?

? ? System.out.println(three%=one); ? ?

? ? ? ??

簡(jiǎn)單點(diǎn)這樣不就行了,你那個(gè)為啥都是0,評(píng)論里有個(gè)哥們說(shuō)了啦,那樣寫(xiě)相當(dāng)如不斷重復(fù)賦值給three(最后一個(gè)three%=one;的結(jié)果為0),所以你輸出的都是three=0(除開(kāi)前面帶的字符)

0 回復(fù) 有任何疑惑可以回復(fù)我~

我建議改為這樣,就會(huì)有你想要的結(jié)果啦!!!http://img1.sycdn.imooc.com//58f8f255000109f305470376.jpg

0 回復(fù) 有任何疑惑可以回復(fù)我~

為什么要分開(kāi)呢 ?不分開(kāi) 他會(huì)用哪個(gè)呢


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Java入門(mén)第一季(IDEA工具)
  • 參與學(xué)習(xí)       1168181    人
  • 解答問(wèn)題       18754    個(gè)

0基礎(chǔ)萌新入門(mén)第一課,從Java環(huán)境搭建、工具使用、基礎(chǔ)語(yǔ)法開(kāi)始

進(jìn)入課程
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)