Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- n,i: integer;
- s: string;
- begin
- readln(n);
- readln(s);
- for i:=1 to length(s) do
- if (i<n-2) and (s[i]='o') and (s[i+1]='g') and (s[i+2]='o') then
- begin
- write('***');
- i:= i + 3;
- while (s[i]='g') and (s[i+1]='o') do
- i:= i + 2;
- end
- else
- write(s[i]);
- writeln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement