Язык:
Русский
English
{ Пример программы для процедуры GetTime }
uses Dos, Crt;
var
H, M, S, Hund : Word;
function LeadingZero(W : Word) : String;
var
S : String;
begin
Str(W : 0, S);
if Length(S) = 1 then
S := '0' + S;
LeadingZero := S;
end;
begin
GetTime(H, M, S, Hund);
WriteLn('Сейчас ', LeadingZero(H), ':', LeadingZero(M), ':',
LeadingZero(S), '.', LeadingZero(Hund));
end.
var
H, M, S, Hund : Word;
function LeadingZero(W : Word) : String;
var
S : String;
begin
Str(W : 0, S);
if Length(S) = 1 then
S := '0' + S;
LeadingZero := S;
end;
begin
GetTime(H, M, S, Hund);
WriteLn('Сейчас ', LeadingZero(H), ':', LeadingZero(M), ':',
LeadingZero(S), '.', LeadingZero(Hund));
end.