![](https://csdnimg.cn/release/download_crawler_static/87220838/bg1.jpg)
万年历的 C 语言编程实现源程序:
#include<stdio.h>
#include<stdlib.h>
int Isleapyear(int y)/*判断是否是闰年*/
{
if((y%4==0&&y%100!=0)||(y%400==0))
return 1;
else
return 0;
}
int Getdaysofmonth(int y,int m)/*确定某个月的天数*/
{
int months[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if(Isleapyear(y))/*如果是闰年则 2 月份的天数改变为 29*/
months[2]=29;
return months[m];
}
评论0
最新资源