Read a book

Report a typo

You have a text of some book in the file book.txt. You need to read it using a scanner, print all lines from the file. Your friend tried to help you, but he wrote code lines in the wrong order and without indentation. Please, correct the code.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                while (it.hasNext()) {
              
                }
              
                }
              
                val scanner = Scanner(File("book.txt"))
              
                println(it.nextLine())
              
                scanner.use {
              
                fun main() {
              
___

Create a free account to access the full topic