返回列表 發帖
本帖最後由 卓炘暘 於 2021-1-21 15:55 編輯
  1. import java.io.Console;
  2. public class Ch07
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         int x;
  7.         float y;
  8.         Console c=System.console();
  9.         x=Integer.parseInt(c.readLine("輸入一整數: "));
  10.         System.out.println("剛輸入: "+x);
  11.         y=Float.parseFloat(c.readLine("輸入一浮點數: "));
  12.         System.out.printf("剛輸入: "+y);


  13.     }
  14. }
複製代碼

TOP

返回列表