Date: 03/21/06 (Code WTF) Keywords: no keywords function WeekCount(x: Integer): Integer; // в W хранится число недель,
begin // а как результат возвращается
if (x >= 7) then begin // остаток в днях.
W := W + 1;
result := WeekCount(x-7); // Чтобы понять рекурсию, надо понять рекурсию
end else result := x;
end;
Source: http://community.livejournal.com/code_wtf/32425.html
|