在程序开头加上下面这段代码: #define _CRT_SECURE_NO_WARNINGS 1 #pragma warning(disable:4996) #pragma warning(disable:6031)