C语言程序设计报告—“万年历”.
#include"stdio.h"
intjudge(intyear,intmonth)/*定义一个函数,把月分为四类(28,29,30,31)*/
{
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
return(1);/*31天的月份,返回值为1*/
elseif(month==2)
{
if(year%4!=0||year%100==0&&year%400!=0)
return(2);/*平年的2月份,返回值为2*/
elsereturn(3);/*闰年的2
下载地址
用户评论