例如像https://www.luogu.com.cn/problem/P1904 这类不知道输入有多少个数量的,并且也没给n,java如何输入?百度都是说什么hasNext()但是完全没用,因为还是会卡在输入,执行不了下一步。