Thursday, April 22, 2010

เอา BufferedRW มาใช้งาน

// BufferedRW.java ใช้แบบนี้ ดี

import java.io.*;

class BufferedRW {

    public static void main(String args[]) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        String s;

        while ((s = br.readLine()) != null)

            bw.write(s + "\n");

        bw.close();

    }

}


 

No comments:

Post a Comment