PlasmaVNGaming

Untitled

Apr 17th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var s: string;
  2. i, count, max, start, number, maxstart: integer;
  3. c: char;
  4.  
  5. begin
  6. readln(s);
  7. s:=s+' ';
  8. count:=1;
  9. max:=0;
  10. number:=1;
  11. c:=s[1];
  12. for i:=2 to length(s) do
  13. begin
  14. if c = s[i] then
  15. begin
  16. Inc(count);
  17. end
  18. else
  19. begin
  20. if count > max then
  21. begin
  22. maxstart:=start;
  23. max:=count;
  24. end;
  25. count:=1;
  26. start:=i;
  27.  
  28. end;
  29. c:=s[i];
  30. end;
  31. for i:=maxstart to maxstart + max - 1 do
  32. write(s[i]);
  33. readln;
  34. end.
Advertisement
Add Comment
Please, Sign In to add comment