赞
踩
问题:求解year1-month1-day1 和 year2-month2-day2的日期差
思路:将两个date间的间隔天数计算转换为计算两个日期到同一基准日期的天数差
说明(如图所示):
- /* calculate :How many days between year1-month1-day1 and year2-month2-day2 */
- #include <stdio.h>
- int monthDays[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
- int totalDays[13];
- int isLeapYear(int year){
- return year%4==0 && year%100!=0 ||
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。