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

请问哪位大佬能看出问题所在 教教小白

public class HelloWorld{

    public static void main(String[] args) {

        int one = 10 ;

        int two = 20 ;

        int three = 0 ;

        three = one + two;

        int age1=one+two;

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

        three += one;

        int age2=three+=one;

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

        three -= one;

        int age3=three-=one;

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

        three *= one;

        int age4=three*=one;

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

        three /= one;

        int age5=three/=one;

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

        three %= one;

        int age6=three%=one;

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

    }

}


提问者:翔9131174 2023-11-13 21:21

个回答

  • 慕先生5405824
    2023-11-22 20:00:43

    你所有的System.out.println()中的()用的都是中文(),换成英文的()就对了。

    exp{
    
        (String[] args) {
    
            one = ;
    
            two = ;
    
            three = ;
    
            three = one + two;
    
            age1=one+two;
    
            System..println(+age1);
    
            three += one;
    
            age2=three+=one;
    
            System..println(+age2);
    
            three -= one;
    
            age3=three-=one;
    
            System..println(+age3);
    
            three *= one;
    
            age4=three*=one;
    
            System..println(+age4);
    
            three /= one;
    
            age5=three/=one;
    
            System..println(+age5);
    
            three %= one;
    
            age6=three%=one;
    
            System..println(+age6);
    
        }
    
    }