问答详情
源自:3-3 Java中的赋值运算符

int one = 10 ; int two = 20 ; int three = 0; three=one+two; three=three/one;=0 three/=one;=30我始终不明白three/=one为什么等于30

 int one = 10 ;        

 int two = 20 ;        

 int three = 0;        

 three=one+two; 

 three=three/one;=0  

three/=one;=30我始终不明白three/=one为什么等于30

提问者:陌生学习 2018-11-09 17:05

个回答

  • qq_終奌傷起奌
    2018-11-18 18:41:23

    300除以10不就是30吗!

  • 轻秋
    2018-11-10 19:31:56

            int one = 10 ;

            int two = 20 ;

            int three = 0 ;

            three = one + two; //当前three为:10+20=30

            three += one; //当前three为:30+10=40

            three -= one; //当前three为:40-10=30

            three *= one; //当前three为:30*10=300

            three /= one; //当前three为:300/10=30

            每次计算three的值都在变


  • 慕沐6179892
    2018-11-09 18:15:11

    300/10=30