public class jishuangqi{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
int a=one+two;
int b=one+a;
int c=b-two;
int d=a*one;
int e=d/one;
int f=e/three;
System.out.println("three=one+two==>"+a);
System.out.println("three+=one ==>"+b);
System.out.println("three-=one==>"+c);
System.out.println("three*=one==>"+d);
System.out.println("three/=one==>"+e);
System.out.println("three%=one==>"+f);
}
}
Java中整数除以0会抛出异常,算术运算异常ArithmeticException,你的f就是整数除以0了