- import java.io.*;
- public class Ch100 {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
-
- int n;
- String str;
- Ch100() throws Exception {
- System.out.println("輸入一個字串(帶空白):");
- str = br.readLine();
- System.out.println(str);
- System.out.println("輸入一個整數:");
- n = Integer.parseInt(br.readLine());
- System.out.println(n);
- }
- public static void main(String[] args) throws Exception {
- new Ch100();
- }
- }
複製代碼 |