Фух. допилил программку. лови решение:
program parser;
var
a : array[1..255] of string;
i, cnt : integer;
sum1, sum2, sum3, sum4, sum5, sum6, sum7 : integer;
ch, last : char;
st : string;
dbl : boolean;
begin
write('Input a string: ');
readln(st);
last := ' ';
cnt := 1;
dbl := false;
for i:=1 to length(st) do
begin
ch := st[i];
if (ch in ['<', '>', ':', '=']) and (last=' ') then begin
if dbl then begin
dbl:= not dbl;
continue;
end;
last := ch;
ch := st[i+1];
if (ch='=') or (ch='>') then begin
a[cnt] := last + ch;
writeln(a[cnt]);
cnt := cnt+1;
dbl := true;
if length(a[cnt-1])=2 then last := ' ';
end
else begin
a[cnt] := last;
writeln(a[cnt]);
cnt := cnt+1;
last := ' ';
end;
end;
end;
sum1 := 0;
sum2 := 0;
sum3 := 0;
sum4 := 0;
sum5 := 0;
sum6 := 0;
sum7 := 0;
for i:=1 to cnt do begin
if a[i] = '<' then inc(sum1);<br> if a[i] = '>' then inc(sum2);
if a[i] = '>=' then inc(sum3);
if a[i] = '<=' then inc(sum4);<br> if a[i] = '<>' then inc(sum5);
if a[i] = ':=' then inc(sum6);
if a[i] = '=' then inc(sum7);
end;
writeln('> - ', sum1);
writeln('< - ', sum2);
writeln('= - ', sum7);
writeln('>= - ', sum3);
writeln('<= - ', sum4);<br> writeln('<> - ', sum5);
writeln(':= - ', sum6);
end.