//★ 標準入力から行単位で入力(throws のサンプルプログラム) 前田 稔
// Ctrl + Z で終了
import java.io.*;
public class Throws
{
public static void main(String[] args)
{ try
{ Line_IO(); }
catch(IOException e)
{ e.printStackTrace(); }
}
public static void Line_IO() throws IOException
{ String line;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
PrintWriter print = new PrintWriter(System.out);
System.out.println("入力してください:");
System.out.print("> ");
while((line=input.readLine()) != null)
{ print.println(line);
System.out.print("> ");
}
print.close();
}
}
|