2022默认禁止了scanf等函数,你可以改用scanf_s 等,或者加上预处理定义 _CRT_SECURE_NO_WARNINGS,具体做法https://blog.csdn.net/qq_43441284/article/details/124870560