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

  2. import javax.sound.midi.SysexMessage;


  3. public class Ch01 {

  4.         public static void main(String[] args) {
  5.             String str1,str2;
  6.             int a;
  7.             float b;
  8.             Scanner s=new Scanner(System.in);
  9.             System.out.print("請輸入一字串(帶空白)");
  10.             str1=s.nextLine();
  11.             System.out.print(str1);
  12.             System.out.print("請輸入一字串(不帶空白)");
  13.             str2=s.next();
  14.             System.out.print("請輸入一整數");
  15.             a=s.nextInt();
  16.             System.out.print(a);
  17.             System.out.print("請輸入一浮點數");
  18.             b=s.nextFloat();
  19.             System.out.print(b);

  20.             
  21.         }


  22. }
複製代碼

TOP

返回列表