Scanner s = new Scanner(System.in);
int choice = 0; if(s.hasNextInt())
{
choice = s.nextInt();
} s.close();//关闭scanner
2023-08-04 23:12:10
Scanner s = new Scanner(System.in);
int choice = 0; if(s.hasNextInt())
{
choice = s.nextInt();
} s.close();//关闭scanner