ex10.pp 526 B

123456789101112131415161718192021222324252627
  1. Program Example10;
  2. { This program demonstrates the IsValidDateWeek function }
  3. Uses SysUtils,DateUtils;
  4. Var
  5. Y,W,D : Word;
  6. B : Boolean;
  7. Begin
  8. For Y:=2000 to 2004 do
  9. begin
  10. B:=True;
  11. For W:=51 to 54 do
  12. For D:=1 to 7 do
  13. If B then
  14. begin
  15. B:=IsValidDateWeek(Y,W,D);
  16. If Not B then
  17. if (D=1) then
  18. Writeln(Y,' has exactly ',W,' weeks.')
  19. else
  20. Writeln(Y,' has ',W,' weeks and ',D-1,' days.');
  21. end;
  22. end;
  23. End.