返回列表 發帖
  1. package  eric303;
  2. import java.rmi.MarshalException;
  3. import java.util.Scanner;
  4. public class eee {
  5.         public static void main(String[] args) throws  Exception
  6.         {
  7.         Scanner scanner= new Scanner(System.in);
  8.         System.out.println("分子:");
  9.         int num4=scanner.nextInt();
  10.         System.out.println("分母:");
  11.         int num5=scanner.nextInt();
  12.         int result=0;
  13.      if(num4!=0){
  14.       result=num4/num4;
  15.      }
  16.      {
  17.              throw new Exception("分母can not be 0");
  18.      }
  19.         }
  20. }
複製代碼

TOP

返回列表