似水流年风萧兮的博客 * 计算两个日期之间相隔的天数 * * @author zql * */ public class Test { public static void main(String[] args) { Test t = new Test(); int r = t.getDaySub(2020, 1, 1, 2020, 2, 5); System....
Lucifer176的博客初学,代码不够精简,望指正 #include struct Date { int year; int month; int day; }; int main() { struct ... } 大体思路是将两个日期的天数分别算出,再进行减法,主要注意每个月的天数不一样,还有闰年的问题。