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