加上下面这行
#define _CRT_SECURE_NO_WARNINGS
放在你的程序的第一行
把scanf改成scanf_s试试
https://blog.csdn.net/qq_44094415/article/details/106416234