For the C language's question about "input contains multiple lines of data, please handle to end of the file", multiple lines
Today, when I was in the ACM competition, I encountered the following requirement in the input format: the input contains multiple rows of data. Please process it until the end of the file. The logic of the question is very simple, and the main function code is easy to implement, but the question does not "clearly" indicate how the input data in the console ends, such as: # And double carriage return. I tried to use the clock_t variable to control the program running time, but the "Compilation error" was displayed on the evaluation platform ". After careful analysis, the author gets the answer: "input contains multiple rows of data, please process until the end of the file" means that when you input enough data, you can use "Ctrl + Z" to exit the console, that is, "processing file ends". The reason is: Ctrl + Z will make the scanf () function return-1, so when dealing with this type of problem, you can use "while (scanf (" % d ", & a, & B )! = EOF) {function.