public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; int three=one+two; int three+=one; int three-=one; int three*=one; int three/=one; int 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*=one==>;"+three); System.out.println("three/=one==>;"+three); System.out.println("three%=one==>;"+three);
7 回答
已采纳
loren_ll
TA贡献2条经验 获得超0个赞
1.代码不完整 缺少花括号;
2.双引号中的代码,程序只会原样输出,并且,你这个都是计算完了再输出,所以这6个打印出的都是最后一个three的值:0
3.最好自己在编译器中运行看看.
添加回答
举报
0/150
提交
取消