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

  3. public class P5 {

  4.         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  5.         String str;
  6.         int n;

  7.         P5() throws Exception
  8.         {
  9.                 System.out.print("請輸入一字串(帶空白): ");
  10.                 str=br.readLine();
  11.                 System.out.println(str);
  12.                 System.out.print("請輸入一整數: ");
  13.                 n=Integer.parseInt(br.readLine());
  14.                 System.out.println(n);
  15.         }

  16.         public static void main(String[] args) throws Exception{
  17.                 new P5();
  18.         }
  19. }
複製代碼

TOP

返回列表