返回列表 發帖
  1. import java.util.Scanner;
  2. public class ch41
  3. {
  4.        public static void main(String args[])
  5.        {
  6.               Scanner s=new Scanner(System.in);
  7.               String a;
  8.               int b;
  9.               float c;
  10.               System.out.print("輸入一字串: ");
  11.               a=s.next();
  12.               System.out.println(a);
  13.               System.out.print("輸入一整數: ");
  14.               b=s.nextInt();
  15.               System.out.println(b);
  16.               System.out.print("輸入一浮點數: ");
  17.               c=s.nextFloat();
  18.               System.out.println(c);
  19.        }
  20. }
複製代碼

TOP

返回列表