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);
}
}
执行总是出错,why???
恩,分号输入错了
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);
}
}
除了第一个输出使用英文分号; 后面几个都是用中文分号;。
提示哪行出错?