ex3.pp 340 B

1234567891011121314151617181920212223
  1. Program Example3;
  2. uses Dos;
  3. { Program to demonstrate the GetTime function. }
  4. Function L0(w:word):string;
  5. var
  6. s : string;
  7. begin
  8. Str(w,s);
  9. if w<10 then
  10. L0:='0'+s
  11. else
  12. L0:=s;
  13. end;
  14. var
  15. Hour,Min,Sec,HSec : word;
  16. begin
  17. GetTime(Hour,Min,Sec,HSec);
  18. WriteLn('Current time');
  19. WriteLn(L0(Hour),':',L0(Min),':',L0(Sec));
  20. end.