题目要求是多行输入,而代码里只循环了三次而已
附一下自己写的代码
#include <cstdio>
int main()
{
int input = 0, _max = 0;
while (scanf ("%d", &input) != EOF) {
if (input > _max) _max = input;
if (input == 0) {
printf("%d\n", _max);
_max = 0;
}
}
return 0;
}