运算结果three =one + two ==>0

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

}


MAX9
浏览 1551回答 3
3回答

习惯受伤

没错,最后答案就是0,计算f时当时的值是: a = 30; int f = a %= 10; 从右往左计算,先计算a %= 10,计算完 就是等于0
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java