第一个问题,我这里没问题,估计是哪个题目你处理的不对。 第二个问题,一般用的是  while(scan.hasNext()){             String str = scan.nextLine();           } 这样的
image.png