"> inc (i);
end;
if ee then
if q = 4 then
begin
writeln (0);
for i: = 1 to col do write ('M (', i, ') =', m [i], # 32);
writeln;
end else writeln (3);
close (input);
close (output);.
Варіант № 3: ms: array [1 .. 4,1 .. 4] of byte = (
{Ц Б,;}
{S} (0,2,0,0),
{Q} (2,2,3,4),
{P} (0,2,0,0),
{Z} (0,0,0,0)); ps: array [1 .. 4,1 .. 4] of byte = (
{Ц Б,;}
{S} (0,2,0,0),
{Q} (2,2,1,0),
{P} (0,2,0,0),
{Z} (0,0,0,0));
num: set of char = ['0 '.. '9'];
sym: set of char = ['A' .. 'Z', 'a' .. 'z'];
ee: boolean = true; s: string;
i, q, oq, ns: byte;
col: byte;
S_: array [1 .. 100] of string;
assign (input, 'input.txt');
assign (output, 'output.txt');
reset (input);
rewrite (output);
readln (s);
col: = 1; fillchar (s_, sizeof (s_), # 0);
writeln (s); i: = 1; q: = 1;
while (i <= byte (s [0])) and ee do
begin
oq: = q;
if s [i] in num then ns: = 1 else {}
if s [i] in sym then ns: = 2 else {Визначення}
if s [i] = ',' then ns: = 3 else {номери}
if s [i] = ';' then ns: = 4 else ns: = 0; {символу}
case ps [q, ns] of
1: inc (col);
2: s_ [col]: = s_ [col] + s [i];
end;
q: = ms [q, ns];
if ns = 0 then
begin
ee: = false;
writeln (1);
end else
if q = 0 then
begin
ee: = false;
writeln (2);
end;
inc (i);
end;
if ee then
if q = 4 then
begin
writeln (0);
for i: = 1 to col do write ('S (', i, ') =', s_ [i], # 32);