This number format error is coming because you can't format space characters in the base 10. I can see many extra whitespaces is there in your input, split(" ") this will not work.
(数字格式错误即将到来,因为您无法在基数10中设置空格字符。我可以看到输入中还有很多额外的空格,split(“”)不能使用。)
So replace normal white space split with regex.
(因此,用正则表达式替换普通的空格分割。)
use the below code and it will take care of extra whitespaces in your input. (使用下面的代码,它将处理输入中的多余空格。)
String[] parts = line.trim().split("\s+");
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…