請問這個是哪里錯了???
public class HelloWorld{
? ? public static void main(String[] args) {
? ?int one = 10 ;
? ? ? ? int two = 20 ;
? ? ? ? int three = 0 ;
? ? ? ? three=one+two;
? ? ? ? System.out.println("three=one+two==>"+three);
? ? ? ? three+=one;
? ? ? ? System.out.println("three+=one==>"+three);
? ? ? ? three-=one;
? ? ? ? System.out.println("three-=one==>"+three);
? ? ? ? three*=one;
? ? ? ? System.out.println("three*=one==>"+three);
? ? ? ? three/=one;
? ? ? ? System.out.println("three/=one==>"+three);
? ? ? ? three%=one;
? ? ? ? System.out.println("three%=one==>"+three);
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ??
}
}
2019-01-06
我想這應該是這道題的本意? ? 而不是讓你們直接把他的原代碼寫過去? ?不知道你們發(fā)現(xiàn)了沒有? 他的每一句代碼都是通過上一句代碼繼承下來的three結果? 之后再去進行賦值運算? ?
2018-12-29
你好,你的代碼是可以正常編譯的。
如果在網頁報錯,你可以點一下再試試,重新提交,我之前也遇到過類似的情況。
下圖是我將你的代碼復制在eclipse上的運行結果: