blob: 9d6a4e2b53f5a31ea423495a122ec6f9c557e438 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
program Ch1;
{$mode objfpc}
uses
SysUtils;
function DigitalClock(constref Str:AnsiString):ShortInt;
begin
if(Str[1] = '?') then
if(StrToInt(Str[2]) < 4) then Exit(2) else Exit(1)
else if(Str[2] = '?') then
if(StrToInt(Str[1]) < 2) then Exit(9) else Exit(3)
else if(Str[4] = '?') then
Exit(5)
else
Exit(9);
end;
begin
WriteLn(DigitalClock('?5:00'));
WriteLn(DigitalClock('?3:00'));
WriteLn(DigitalClock('1?:00'));
WriteLn(DigitalClock('2?:00'));
WriteLn(DigitalClock('12:?5'));
WriteLn(DigitalClock('12:5?'));
end.
|