万年历C++课程设计报告
}
void g(int y[],int z) // 输出日历表 {
cout<<"日"<<'\t'<<"一"<<'\t'<<"二"<<'\t'<<"三"<<'\t'<<"四"<<'\t'<<"五"<<'\t'<<"六"<<endl;
for(i=0;i<50;i++) {
if(a[i]==0)
cout<<(char)a[i]<<'\t'; if(a[i]!=0&&a[i]!=33) cout<<a[i]<<'\t'; else ;
if(i%7==0) cout<<endl; }
cout<<endl<<endl<<endl; }
int main() {
int s,count=0;
cout<<"请输入年份:"; cin>>year; cout<<endl; c=year;
for(s=1;s<=year;s++)
if(((s-1)%4==0&&(s-1)%100!=0)||(s-1)%400==0) count++;
day=365*c+count; //相差天数
cout<<"*********************"<<year<<"年日历*********************"; cout<<endl<<endl<<endl<<endl;
k=(day%7+6)%7+1;
cout<<"一月"<<endl<<endl; f1(k); g(a,50);
if((year%4==0&&year%100!=0)||year%400==0) //闰年二月 {
k=((day+31)%7+6)%7+1;
cout<<"二月"<<endl<<endl; f3(k);
g(a,50);
day=day+31+29; }