B
B
BitNeBolt2021-07-17 11:08:44
Java
BitNeBolt, 2021-07-17 11:08:44

Why is part of the string lost? How to avoid it?

The answer to the problem contains many (300,000) six-digit numbers that need to be printed quickly, for this I use BufferedWriter, but on one of the tests part of the string is lost: wrong answer 298290th numbers differ - expected: '78442', found: '78' . I wrote the answer to a file and did not find a separate number 78 there. What is the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
BitNeBolt, 2021-07-27
@BitNeBolt

Need to flush

G
GavriKos, 2021-07-17
@GavriKos

The fact that the code is written crookedly. And the fact that you think that all the Wangs are here and will guess what is going wrong without a description at all

S
Sergey Gornostaev, 2021-07-17
@sergey-gornostaev

Use a debugger.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question