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

TOP

返回列表