大侃
2015-01-16 14:14
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);
30=10+20=30
30+=30+10=40
30-=40-10=30
30*=30*10=300
30/=300/10=30
30%=30%10=0?
%=是模等于什么叫模等于?
这里我不懂啊?怎么是0?
three=one+two ==> three = 10+20 = 30
three+=one ==> three = three + one = 30+10 = 40
three-=one ==> three = three - one = 40 - 10 = 30
three*=one ==> three = three * one = 30 * 10 =300
three/=one ==> three = three / one = 300 / 10 =30
three%=one ==> three = three%one = 30%10 =0 //这里的意思是取余操作,30对10取余,不就是0吗~
%是求余 的方法。 30%10 是0 30%11 就是1咯。 以此类推
Java入门第一季(IDEA工具)升级版
1165172 学习 · 17581 问题
相似问题
回答 1