The program works without any problems but it still does not pass me one task option.
package pl.codegym.task.task13.task1319;
import java.io.*;
/*
Zapisywanie do pliku z konsoli
*/
public class Solution {
public static void main(String[] args) throws IOException {
// tutaj wpisz swój kod
try {
File file = new File("C:\\Users\\Admin\\Desktop\\zapis.txt"); // tworzy plik
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // Strumień do odczytu z konsoli
FileWriter fr = new FileWriter(file); // Strumień, który łączy się z plikiem tekstowym
BufferedWriter bw = new BufferedWriter(fr); // Połącz FileWriter z BufferedWriter
String word;
String exit = "exit";
do {
word = br.readLine();
bw.write(word); // write line String do stream
bw.newLine();
} while (!word.equals(exit));
br.close();
bw.close();
}catch (IOException e){
e.printStackTrace();
}
}
}