C语言.写万年历.总天数s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+1.为什么要加1?
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 13:02:13
C语言.写万年历.总天数s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+1.为什么要加1?C语言.写万年历.总天数s=(year-1)*365+
C语言.写万年历.总天数s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+1.为什么要加1?
C语言.写万年历.总天数s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+1.为什么要加1?
C语言.写万年历.总天数s=(year-1)*365+(year-1)/4-(year-1)/100+(year-1)/400+1.为什么要加1?
简单的说:从1号到5号是几天?计算得话:5-1=4(天),显然不对,所以要加上本身的那天,也就是5-1+1=5(天),这么说应该能明白了吧?