万年历C语言代码Word格式.docx

上传人:b****1 文档编号:5954586 上传时间:2023-05-05 格式:DOCX 页数:5 大小:14.54KB
下载 相关 举报
万年历C语言代码Word格式.docx_第1页
第1页 / 共5页
万年历C语言代码Word格式.docx_第2页
第2页 / 共5页
万年历C语言代码Word格式.docx_第3页
第3页 / 共5页
万年历C语言代码Word格式.docx_第4页
第4页 / 共5页
万年历C语言代码Word格式.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

万年历C语言代码Word格式.docx

《万年历C语言代码Word格式.docx》由会员分享,可在线阅读,更多相关《万年历C语言代码Word格式.docx(5页珍藏版)》请在冰点文库上搜索。

万年历C语言代码Word格式.docx

intyear,month,a,b,c,m,n=28;

/*定义变量*/

longe;

printf("

请输入年份"

);

scanf("

%d"

&

year);

e=year;

e--;

/*前一年*/

e=(e*365+e/4)%7;

/*计算这一年的第一天是星期几*/

m=e;

/*把第一天的日期赋给m*/

if((year%4==0)||(year%100!

=0)&

&

(year%400!

=0))/*如果是闰年*/

n++;

%d的日历:

"

year);

for(month=1;

month<

=12;

month++)

if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)/*这几个月每个月都是31天*/

c=0;

printf("

\n"

%d月\n"

month);

日一二三四五六\n"

for(b=1;

b<

=m;

b++)

c++;

"

/*从星期日开始到这个月开始的那天前都是空的*/

}

for(a=1;

a<

=31;

a++)

if(c%7-1==0&

c!

=1)/*判断一行是否已排满,满了就要换行*/

if(a<

10)/*如果是小于10,空一格,大于10,前后空*/

%d"

a);

m++;

if(m==7)/*一行排满,开始换行。

(指的是这个月的最后一行)*/

m=0;

else

if(month==4||month==6||month==9||month==11||month==2)

if(month==2)/*判断2月份*/

{

c=0;

printf("

c++;

printf("

=n;

if(c%7-1==0&

=1)

if(a<

10)

m++;

if(m==7)

m=0;

}

else

for(b=1;

{

c++;

printf("

}

for(a=1;

=30;

if(c%7-1==0&

if(a<

m++;

if(m==7)

m=0;

}

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 销售营销

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2