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