The programs that you have created so far have read all of their input from the keyboard. As a result, it has been necessary to type all of the values needed by those programs each time they are run. This is inefficient, particularly for programs that require a lot of input. Similarly, your programs have displayed all of their results on the screen. While this works well when only a few lines of output are printed, it is impractical for larger results that move off the screen too quickly to be read, or for output that requires further analysis by other programs. Writing programs that use files effectively will allow you to address these concerns.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Files and Exceptions

  • Ben Stephenson

摘要

The programs that you have created so far have read all of their input from the keyboard. As a result, it has been necessary to type all of the values needed by those programs each time they are run. This is inefficient, particularly for programs that require a lot of input. Similarly, your programs have displayed all of their results on the screen. While this works well when only a few lines of output are printed, it is impractical for larger results that move off the screen too quickly to be read, or for output that requires further analysis by other programs. Writing programs that use files effectively will allow you to address these concerns.