Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var s: string;
- i, count, max, start, number, maxstart: integer;
- c: char;
- begin
- readln(s);
- s:=s+' ';
- count:=1;
- max:=0;
- number:=1;
- c:=s[1];
- for i:=2 to length(s) do
- begin
- if c = s[i] then
- begin
- Inc(count);
- end
- else
- begin
- if count > max then
- begin
- maxstart:=start;
- max:=count;
- end;
- count:=1;
- start:=i;
- end;
- c:=s[i];
- end;
- for i:=maxstart to maxstart + max - 1 do
- write(s[i]);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment