Paste Search Dynamic
Recent pastes
maxLen
  1. var maxLen, curLen, i: integer;      
  2.     s: string;
  3. begin
  4.   assign(input, '24.txt');  
  5.   readln(s);
  6.   maxLen := 1;
  7.   curLen := 1;
  8.   for i:=2 to Length(s) do
  9.     if (s[i] = s[i-1]) and (s[i] = 'A') then begin
  10.       curLen := curLen + 1;
  11.       if curLen > maxLen then
  12.         maxLen := curLen;
  13.     end
  14.     else
  15.       curLen := 1;
  16.   writeln(maxLen);  
  17. end.
Parsed in 0.002 seconds