程序运行直接跳过了String name= sc.next Line();
在输入姓名前添加代码:sc.nextLine(); //吞掉\n
可以参考:https://blog.csdn.net/qq_45886144/article/details/125569175