一个关于java执行顺序的问题

2025-04-23 16:45:39
推荐回答(1个)
回答1:

nextLine读入了输入nextInt()时留下的换行符。使用next(),不要使用nextLine()。或者先使用一次nextLine()过滤换行符。