返回列表 發帖
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;

  3. public class B1 {
  4.         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  5.         String str;
  6.         int n;
  7.         B1() throws Exception{
  8.                 System.out.print("請輸入一字串(帶空白):");
  9.                 str=br.readLine();
  10.                 System.out.println(str);
  11.                 System.out.print("請輸入一整數: ");
  12.                 n=Integer.parseInt(br.readLine());
  13.                 System.out.println(n);
  14.         }
  15.         public static void main(String[] args) throws Exception{
  16.                 new B1();
  17.         }
  18. }
複製代碼

TOP

返回列表