Advertisement
Semior001

a cf technocup otbor

Nov 20th, 2016
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.30 KB | None | 0 0
  1. var
  2.     n,i: integer;
  3.     s: string;
  4. begin
  5.     readln(n);
  6.     readln(s);
  7.     for i:=1 to length(s) do
  8.         if (i<n-2) and (s[i]='o') and (s[i+1]='g') and (s[i+2]='o') then
  9.         begin
  10.             write('***');
  11.             i:= i + 3;
  12.             while (s[i]='g') and (s[i+1]='o') do
  13.                 i:= i + 2;
  14.         end
  15.         else
  16.             write(s[i]);
  17.     writeln;
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement