请帮忙看一下 为什么无法得出结果
//file name:Julian.cpp//Calendar conversion
#include <iostream>
using namespace std;
char *Julian(int year,int day);
int main()
{int day,year;
cout<<"请输入年份:"<<endl;
cin>>year;
cout<<"请输入天数:"<<endl;
cin>>day;
Julian(year,day);
return 0;
}
char *Julian(int year,int day)
{char*date=new char[7];
char *month[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
int i;
int dayin[12]={31,28,31,30,31,30,31,31,30,31,30,31};
if((year%4==0&&year%100!=0)||(year%400==0)) ++dayin[1];
for(i=0;day<dayin[i];++i){day-=dayin[i];
strcpy(date,month[i]);}
date[3]=' ';
if(day>9){ date[4]=day/10+'0';
date[5]=day%10+'0';
date[6]='\0';
}
else {date[4]=day+'0';
date[5]='\0';
}
return date;
}
程序如上 但却没有办法返回一个值,就直接结束了
麻烦大神们看一下该怎么改