做上机题,遇到问题
import java.io.*;
import java.util.*;
class Sorts
{
public static void main(String args[])throws Exception
{
int count;
byte b[]=new byte[1024];
InputStreamReader in;
FileWriter out;
BufferedReader br;
FileInputStream fis;
FileOutputStream fos;
try{
in=new InputStreamReader(System.in);
br=new BufferedReader(in);
out=new FileWriter( "F:\\1\\Test\\3\\test.txt ");
System.out.println( "请输入#结束键盘输入: ");
String str=br.readLine();
while(!str.equals( "# ")){
out.write(str+ "\r\n ");
str=br.readLine();
}
in.close();
out.close();
br.close();
}catch(
IOException e){}
fis=new FileInputStream ( "F:\\1\\Test\\3\\test.txt ");
fos=new FileOutputStream( "F:\\1\\Test\\3\\test1.txt ");
try{
while((count=fis.read(b,0,1024))!=-1){
int c[] = new int[20];
for(int i=0; i <20; i++) {
if (b[i] != 32 && b[i] != 13 && b[i] != 10)
c[i] = b[i];
}