為什么不行呀大神看看哪里錯(cuò)誤了
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);
?????
???
?}
}
2020-03-06
Java中整數(shù)除以0會(huì)拋出異常,算術(shù)運(yùn)算異常ArithmeticException,你的f就是整數(shù)除以0了