import java.util.Date;
import java.io.*;                                        // 引入输入输出包
class Example5_2 {                                    
    public static void main(String[] args) {
        int b = 0;
        byte buffer[] = new byte[50];
        System.out.print("请输入：");
        try {
            b = System.in.read(buffer);
        } 
        catch (IOException e) {
            System.out.println(e);
       } 
       String s = new String(buffer, 0, b - 2);                 // 将字节数组buffer转换为字符串
       System.out.println(s);
       System.out.println(new Date(System.currentTimeMillis()));
    }
}
