离觞殇
2019-03-01 21:33
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
three=one+two;
System.out.printf("three = one + two ==>" + three);
three+=one;
System.out.printf("three += one ==>" + three);
three-=one;
System.out.printf("three -= one ==>" + three);
three*=one;
System.out.printf("three *= one ==>" + three);
three/=one;
System.out.printf("three /= one ==>" + three);
three%=one;
System.out.printf("three %= one ==>" + three);
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);
}
}
我给你改完了,你看看你的代码和我写的是不是一样。注意两点结尾的}你有几个。println这个单词是否打对了。
+ three在一开始加一次就可以了吧。不用在每个打印里都加一次把。如果加的话,会重叠。
System.out.println
Java入门第一季(IDEA工具)升级版
1165175 学习 · 17581 问题
相似问题