public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; int a =one+two; int b =two*2; int c =(two*2)-one; int d =two*=one; int f =two/
運算正確了? 但是倒數(shù)第二個數(shù)值算成了20 什么情況
運算正確了? 但是倒數(shù)第二個數(shù)值算成了20 什么情況
2020-02-06
舉報
2020-02-12
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=one+two));
??????? System.out.println("three += one ==>"+ (three+=one));
??????? System.out.println("three -= one ==>"+ (three-=one));
??????? System.out.println("three *= one ==>"+ (three*=one));
??????? System.out.println("three /= one ==>"+ (three/=one));
??????? System.out.println("three %= one ==>"+ (three%=one));
?}
}
這樣是不是更好呢
2020-02-06
int d=(two*=one) 這樣試試