m: array [1 .. 100] of longint;
v: longint;
sign: shortint;
assign (input, 'input.txt');
assign (output, 'output.txt');
reset (input);
rewrite (output);
readln (s);
col: = 1; v: = 0; sign: = +1;
fillchar (m, 400,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] = '-' then ns: = 2 else {номери}
if s [i] = '+' then ns: = 3 else ns: = 0; {символу}
case ps [q, ns] of
1: M [col]: = M [Col] * 10 + byte (s [i]) -48;
2: begin v: = v + sign * M [col]; inc (col); sign: = +1; end;
3: begin v: = v + sign * M [col]; inc (col); sign: = -1; end;
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 = 2 then
begin
writeln ('0 '); v: = v + sign * M [col];
for i: = 1 to col do write ('M (', i, ') =', M [i], # 32);
writeln ('v =', v);
end else writeln ('3 ');
close (input);
close (output);.
Варіант № 8: ms: array [1 .. 4,1 .. 3] of byte = (
{', c}
{S} (2,0,0),
{T} (3,2,2),
{Z} (2,4,0),
{P} (2,0,0)); ps: array [1 .. 4,1 .. 3] of byte = (
{', c}
{S} (2,0,0),
{T} (0,1,1),
{Z} (1,0,0),
{P} (2,0,0));
sym: set of char = [# 32 .. # 255];
ee: boolean = true; s: string;
i, q, oq, ns: byte;
col: byte;
ws: array [1 .. 100] of string;
assign (input, 'input.txt');
assign (output, 'ou...