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

求解,报错,就是不知道哪里有问题

public class HelloWorld{

    public static void main(String[] args) {

    int one = 10 ;

        int two = 20 ;

        int three = 0 ;

        System.out.println("three = one + two ==>" + three);

        three += one;

        System.out.pringln("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 );

        


提问者:宝慕林9507558 2019-04-09 22:05

个回答

  • 夜夜kawayi呦
    2019-04-09 22:12:02
    已采纳

    少了three=one+two的计算,第二个println打错了。

  • 慕函数2274273
    2019-04-12 20:53:37

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