c语言程序设计:编写函数1实现判断是不是闰年,编写函数2用于输出某年某月的天数

日期:2017-10-26 20:44:45 人气:1

c语言程序设计:编写函数1实现判断是不是闰年,编写函数2用于输出某年某月的天数

c语言程序: #include int RY(int Y){ if ((Y%4==0)&&(Y%100!=0)||(Y%400==0)) return 1; else return 0; } int DYM(int Y, int M){ const short MonthDay[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; if (M==2) return (MonthDay[2]+RY(Y)); else return MonthDay[M
    A+
热门评论