Initially programmed with Liunx, the platform for Learning programming was recently transferred to a Mac. In the meantime there are some problems, especially the line break. When you use an input/output function such as scanf, the expected line-wrapping effect does not occur when you are swapping lines.
Originally, on the three main platforms, the line break's representation is not the same.
In Unix systems, the end of each line is only "< line-wrap >", or "\ n".
Inside the Windows system, each line ends with "< enter >< wrap >", or "\ r \ n".
Mac system, the end of each line is "< Enter >", that is, "\ r".
In this case, if the file under the Unix/mac system is opened in Windows, all the text will be turned into one line, and if the file in Windows is opened under Unix, it will be more than a ^m character at the end of each line.
Linux,windows,mac different representations of line breaks under OS