sc=scanner.nextLine();不能放在其他scanner.nextInt()后面,因为会导致读取/n,导致后面的读取错误
正确姿势:
sc=scanner.nextLine();
sc=scanner.nextLine();
Java的Scanner报错
最新推荐文章于 2023-04-29 10:41:06 发布
sc=scanner.nextLine();不能放在其他scanner.nextInt()后面,因为会导致读取/n,导致后面的读取错误
正确姿势:
sc=scanner.nextLine();
sc=scanner.nextLine();