关于#c++#的问题:我在使用Devc++编译运行的时候,结果显示不全,但是用VisualStudio运行又能显示全了

我在使用Devc++编译运行的时候,结果显示不全,但是用Visual Studio运行又能显示全了?这是为什么?
#include 
#include 

using namespace std;

string str;

string month[12] = { "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };

int main()
{
    cin >> str;

    for (int i = 1; i < 13; i++)
    {
        if (str.substr(0, 3) == month[i])
        {
            cout << i + 1 << " ";
        }
    }
    if (str[3] != '0')
    {
        cout << str[3];
    }
    cout << str[4];
    return 0;

}
Dev的结果

img

VS的结果

img

因为编译器的原因,dev很严格,你总共是12个月,i不应该从1开始,应该从0开始。你设置1~12,12超出了string数组的范围,所以异常退出了。