假设我有一个需求:从data.txt里按行读取一个文件,按格式"[行号]内容"输出,再输出读取的行数。 data.txt: youth is not a time. it is a state of mind. oh, you are right. 很简单: