2013年5月9日
摘要: 实现一个根据输入的年、月、日计算总天数的函数,先用Delphi实现如下(没有考虑2月的特例,如输入2月30日),不过用于汇编练习,可以了: 1 function GetDays(year, month, day: Cardinal): Cardinal; 2 begin 3 Result := month * 30 - 30 + day; 4 if month>1 then 5 Result := Result + (month-1) div 2 + (month-1) mod 2; //31天的月 6 if month>2 then 7 if (year mod ... 阅读全文
posted @ 2013-05-09 19:16 斑马猪 阅读(423) 评论(0) 推荐(0) 编辑