C语言日历源代码.doc
Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-dateC语言日历源代码C语言日历源代码#include <stdio.h>main()int year,month,day,num_month;int j,num=0;printf("请输入年份:");scanf("%d",&year);printf("请输入月份:");scanf("%d",&month);for(j=1980;j<year;j+)if(j%4=0&&j%100!=0|j%400=0)num+=366;else num+=365;switch(month)case 12:num+=30;case 11:num+=31;case 10:num+=30;case 9:num+=31;case 8:num+=31;case 7:num+=30;case 6:num+=31;case 5:num+=30;case 4:num+=31;case 3:if(j%4=0&&j%100!=0|j%400=0)num+=29;else num+=28;case 2:num+=31;case 1:;switch(month)case 1:num_month=31;break;case 2:if(year%4=0&&year%100!=0|year%400=0)num_month=29;else num_month=28;break;case 3:num_month=31;break;case 4:num_month=30;break;case 5:num_month=31;break;case 6:num_month=30;break;case 7:num_month=31;break;case 8:num_month=31;break;case 9:num_month=30;break;case 10:num_month=31;break;case 11:num_month=30;break;case 12:num_month=31;break;printf("n星期日t星期一t星期二t星期三t星期四t星期五t星期六n");for(j=1;j<=(num+2)%7;j+)printf("t");for(j=1;j<=num_month;j+)printf(" %2dt",j);if(num+j-1+2)%7=6)printf("n");printf("n");-