为了账号安全,请及时绑定邮箱和手机立即绑定

public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; int a =one+two; int b =two*2; int c =(two*2)-one; int d =two*=one; int f =two/

运算正确了  但是倒数第二个数值算成了20 什么情况

正在回答

2 回答

public class HelloWorld{
    public static void main(String[] args) {
     int one = 10 ;
        int two = 20 ;
        int three = 0 ;
        System.out.println("three = one + two ==>"+ (three=one+two));
        System.out.println("three += one ==>"+ (three+=one));
        System.out.println("three -= one ==>"+ (three-=one));
        System.out.println("three *= one ==>"+ (three*=one));
        System.out.println("three /= one ==>"+ (three/=one));
        System.out.println("three %= one ==>"+ (three%=one));
 }
}

这样是不是更好呢

0 回复 有任何疑惑可以回复我~
#1

慕工程1031383

这个执行出来是不对的
2020-02-17 回复 有任何疑惑可以回复我~

int d=(two*=one) 这样试试


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; int a =one+two; int b =two*2; int c =(two*2)-one; int d =two*=one; int f =two/

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信