解决方法:1.在顶部添加代码:#pragma warning(disable:4996) 2.在最顶部添加代码:#define _CRT_SECURE_NO_WARNINGS 1 3.将 scanf 改为 scanf_s(VS2022)