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

输出结果为什么不对呢?谢谢老师!!

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);

}

}


输出结果为什么是这个呢?

three = one + two ==>30

three =+ one ==>10

three -= one ==>0

three *= one ==>0

three /= one ==>0

three %= one ==>0


正在回答

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);
     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);我感觉这样就行你那个是不是有点太麻烦了.


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

 three =+ one; 应该是three+=one ,=+相当于赋值

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

一万个为什么

haolihai好厉害啊
2016-01-06 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

输出结果为什么不对呢?谢谢老师!!

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