public class Citire { final static int width = 5; final static int height = 5; public static void main(String[] args) throws IOException { FileReader inputStream = null; FileWriter outputStream = null;
try {
inputStream = new FileReader("input.txt");
outputStream = new FileWriter("output .txt");
int c;
int contorw=0;
int contorh=0;
while ((c = inputStream.read()) != -1) {
outputStream.write(c);
contorw++;
if(contorw%width==0){
outputStream.write("\n");
contorh++;
}
}
} finally {
if (inputStream != null) {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
}
}
}
}