关于 microsoft visual c++ debug library

来源:互联网 发布:红牛 副作用 知乎 编辑:程序博客网 时间:2024/05/16 14:20
std::cout << "Please input a group of numbers : "<< std::endl;
    int a[5];
    std::cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] >> a[5];
    int negative = 0;
    for (int i = 0;i <= 5;i++) {
        if (a[i] < 0)
            negative += 1;
    }

    std::cout << "The numbers of the negative ones is: " << negative << std::endl;


为什么?虽然能运行出正确结果 但是会弹出如下:


原创粉丝点击