vs2019里用scanf_s()代替scanf()函数,代码里这么写:scanf_s("%d", &a);scanf_s()函数说明,供参考:https://baike.baidu.com/item/scanf_s/443572?fr=aladdin