import java.io.*;
public class PrintStreamTest
{
public static void main(String[] args)
{
PrintStream ps = null;
try
{
FileOutputStream fos = new FileOutputStream("C:\\Users\\linjinbao\\Desktop\\a.txt");
ps = new PrintStream(fos);
}
catch (Exception e)
{
}
if(ps != null)
{
System.setOut(ps);
}
int ln = 0;
for(int c = 0; c < 6000; c++)
{
System.out.print(c + " ");
if(ln ++ >= 100)
{
System.out.println();
ln = 0;
}
}
}
}