慕勒0327833
2020-03-05 22:50
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了
Java入门第一季(IDEA工具)升级版
1165172 学习 · 17581 问题
相似问题