新手学c++,写了个代码。自己感觉没有错。可是用vc6.0就是运行不出来。错误一堆。。求大神指导哪里错了。。。


#include <iostream>
#include <string>
using namespace std;

string str[12]={"January 1, ","February 1","March 1, ","April 1, ","May 1, ",
      "June 1, ","July 1, ","August 1, ","September 1, ","October 1, ",
      "November 1, ","December 1, "};
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
string week[7]={"Sunday","Monday","Tuesday","Wednesday",
                  "Thursday","Friday","Saturday"};
int main()
{
    int year;
    int day;
    cin>>year>>day;
    while((year%4 == 0 && year%100 != 0) || (year % 400 == 0))
    { day[1] = day[1]+1;}
    int b[12];
    int    result=day;
    for(int i=0;i<12;i++)
    {
       result=result+day[i]%4;
       if(result>7)
           result=result-7;
       cout<<str[i]<<","<<year<<"is "<<week[result]<<endl;

      }

return 0;
}