qq_城主_0
2015-08-17 13:34
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
System.out.println(three=one+two);
System.out.println(three+=one);
System.out.println(three-+one);
System.out.println(three*=one);
System.out.println(three/=one);
System.out.println(three%=one);
}
}
是这样吗?但是输出后面的==〉30怎么输出?
应该是这样的,
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
System.out.println("three=one+two==>30");
System.out.println("three+=one==>40");
System.out.println("three-+one==>30");
System.out.println("three*=one==>300");
System.out.println("three/=one==>30");
System.out.println("three%=one==>0");
}
}
有个问题,是不是用双信号括起来的直接就可以输出不用再判断了,没有用双信号的语句是否要判断运算呢?
Java入门第一季(IDEA工具)升级版
1165634 学习 · 17587 问题
相似问题