error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
当程序出现上述错误时,在文档开头加上#define _CRT_SECURE_NO_WARNINGS 1命令就可以解决了。
不建议使用scanf_s函数,这是Visual stdio编译提供的,无法跨平台运行。