返回列表 發帖
  1. package lol;

  2. import java.io.BufferedReader;
  3. import java.io.InputStreamReader;

  4. public class Ch01 {

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

  19. }
複製代碼

TOP

返回列表