返回列表 發帖
  1. package test;
  2. import java.util.Scanner;
  3. public class Test
  4. {
  5.     static Scanner s=new Scanner(System.in);
  6.     public static void main(String[] args)
  7.     {   
  8.         int x,y;
  9.         System.out.print("輸入分子: ");
  10.         x=s.nextInt();
  11.         System.out.print("輸入分母: ");
  12.         y=s.nextInt();
  13.         System.out.println(x+"/"+y+"="+(x/y));
  14.     }
  15. }
複製代碼

TOP

返回列表