 
		莫名的奇妙
2016-04-08 16:32
package helloworld;
public class lianxi{
    public static void main(String[] args) {
	    int one = 10 ;
        int two = 20 ;
        int three = 0 ;
        int a,b,c,d,e,f;
        a = one + two ;
        b = three += one ;
        c = three -= one ;
        d = three *= one ;
        e = three /= one;
        f = three %= 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);
        
    }
} 
				不是,应等于10
 
				e = three /= one;
f = three %= one;
e的值等于30,e的值在f = three %= one;中的three中,%是取整除后的余数,30能被10整除无余数,所以最后的值为0
Java入门第一季(IDEA工具)
1168092 学习 · 18754 问题
相似问题