- package eric303;
- import java.rmi.MarshalException;
- import java.util.Scanner;
- public class eee {
- public static void main(String[] args) throws Exception
- {
- Scanner scanner= new Scanner(System.in);
- System.out.println("分子:");
- int num4=scanner.nextInt();
- System.out.println("分母:");
- int num5=scanner.nextInt();
- int result=0;
- if(num4!=0){
- result=num4/num4;
- }
- {
- throw new Exception("分母can not be 0");
- }
- }
- }
複製代碼 |