发布网友 发布时间:2024-08-27 11:57
共1个回答
热心网友 时间:2024-08-31 19:02
建立数学函数模型,某一天为(年x1,月y1,日z1),前一天为(年x2,月y2,日z2)
则几个分段函数如下
1、年函数,1800<=x1<=2050
当y1≠1时,x2=x1
当z1≠1时,x2=x1
当y1=1且z1=1时,x2=x1-1
2、月函数,1<=y1<=12
当z1≠1时,y2=y1
当z1=1且 y1≠1时,y2=y1-1
当y1=1且z1=1时,y2=12
3、日函数,1<=z1<=31
当z1≠1时,z2=z1-1
当z1=1且 y1=1,2,4,6,8,9,11时,z2=31
当z1=1且 y1=5,7,10,12时,z2=30
当z1=1且 y1=3且 x1=4k(451<=k<=474或476<=k<=512)时,z2=29
当z1=1且 y1=3且 x1≠4k(451<=k<=474或476<=k<=512)时,z2=28
4某一天为有效日期的判断函数
当y1=1,3,5,7,8,10,12时,1<=z1<=31
当y1=4,6,9,11时,1<=z1<=30
当x1=4k(451<=k<=474或476<=k<=512)且 y1=2时,1<=z1<=29
当1800<=x1<=2050且
x1≠4k(451<=k<=474或476<=k<=512)且 y1=2时,1<=z1<=28