返回列表 發帖
  1. import java.util.Arrays;
  2. import java.util.Scanner;


  3. public class World {

  4.         public static void main(String[] args) {
  5.                 // TODO 自動產生的方法 Stub

  6.                 Scanner x=new Scanner(System.in);
  7.                 String str1 ,str2;
  8.                 int a;
  9.                 float b;
  10.                 System.out.println("請輸入字串(不帶空白):");
  11.                 str2=x.next();
  12.                 System.out.println(str2);
  13.                 System.out.println("請輸入字串(帶空白):");
  14.                 str1=x.nextLine();
  15.                 str1=x.nextLine();
  16.                 System.out.println(str1);
  17. }
  18. }
複製代碼

TOP

返回列表