谁能帮我修改一下这个万年历
#include<stdio.h>void main()
{
int year,days=0,sum,i,day=0,j;
printf("输入年份:");
scanf("%d",&year);
if(year>=2000){
for(i=2000;i<year;i++){
if(i%4==0&&i%100!=0||i%400==0)
days+=366;
else days+=365;
}
sum=(days%7+6)%7;
}
else if(year<2000){
for(i=1999;i>=year;i--){
if(i%4==0&&i%100!=0||i%400==0)
days+=366;
else days+=365;
}
sum=(6-days%7)%7;;
}
printf("===============================\n");
printf("%4d 年日历\n",year);
printf("===============================\n");
for(i=1;i<=12;i++){
printf("%d月\n",i);
printf(" Su Mo Tu We Th Fr Sa\n");
switch(i){
case 1:case 3:case 5:case 7:case 8:case 10:case 12: day=31; break;
case 2: {
if(year%4==0&&year%100!=0||year%400==0)
day=28;
else day=29;
} break;
case 4:case 6:case 9:case 11: day=30; break;
}
for(j=1;j<=sum;j++)
printf(" ");
for(j=1;j<=day;j++){
printf("%4d",j);
if((j+sum)%7==0)
printf("\n");
}
sum=(sum+day)%7;
printf("\n");
}
}
这个万年历只能竖着打,那个高手能指点一下改成两个月打一行