C语言 请问各位专家哪里出错了

img


求解

百度:'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
找到这个链接的解决办法就解决问题了:


scanf改为scanf_s,根据出错信息的意思大概是这个scanf函数不安全,要用更安全的scanf_s代替。

img

代码:


#include <stdio.h>

int main() {
    int a, b;
    printf("Please enter two numbers:");
    scanf_s("%d %d", &a, &b);
    printf("You enter:%d", a + b);
    return 0;

}


编辑器问题,要安全一点的函数scanf_s

https://blog.csdn.net/qq_43309823/article/details/95386759