这是一个很基本的统计算法主要代码如下:begin readln(n)//长度 for i:=1 to n do
begin
read(ch);//ch为一字符
if ch='T' then begin inc(tt);tf:=0;end
else begin inc(tf);tt:=0; end;
if tt>tmax then tmax:=tt;//tt是T出现的次数,打擂台统计最大
if tf>fmax then fmax:=tf;//tf是F出现的次数,打擂台统计最大
end; writeln(tt);writeln(tf);end. 定义变量你来写吧,很简单