2011年8月18日 星期四

鍵盤輸入 練習


    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        String str;
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        System.out.print("請輸入數字:");
        str = buf.readLine();
        System.out.println(Integer.parseInt(str));
    }

沒有留言 :

張貼留言