返回列表 發帖
本帖最後由 古蕾娜 於 2019-7-1 15:50 編輯
  1. public class Ch06
  2. {
  3.      public static void main(String args[])
  4.       {
  5.          int x;
  6.          float y;
  7.          Console c=System.console();
  8.          System.out.print("Enter a whole number: ");
  9.          x=Integer,parseInt(c.readLine());
  10.          System.out.printlm("The whole number you just entered: "+x);
  11.          System.out.print("Enter a decimal number: ");
  12.          y=Float.parseFloat(c.readLine());
  13.          System.out.print("The decimal number you just entered: "+y);
  14.       }
  15. }
複製代碼
  1. public class Ch06
  2. {
  3.      public static void main(String args[])
  4.       {
  5.          int x;
  6.          float y;
  7.          Console c=System.console();
  8.          x=Integer,parseInt(c.readLine("Enter a whole number: "));
  9.          System.out.printlm("The whole number you just entered: "+x);
  10.          y=Float.parseFloat(c.readLine("Enter a decimal number: "));
  11.          System.out.print("The decimal number you just entered: "+y);
  12.       }
  13. }
複製代碼

TOP

返回列表