问答详情
源自:3-5 Java中的逻辑运算符

Java赋值运算

编程题3-3答案

提问者:LVSIYANG 2016-10-05 02:39

个回答

  • 小蝎子訫圊小Q
    2016-10-05 03:50:55
    已采纳

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