因为
建议用fscanf函数
Linux 下 输入 man fgets 查看 fgets 函数手册可以知道:
fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline. (注意:)If a newline is read, it is stored into the buffer. A terminating null byte ('\0') is stored after the last character in the buffer.
所以fgets()连'\n'一起存储。