SHARE
TWEET

Untitled

a guest Oct 15th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.   s, text : string;
  3.   i, j : integer;
  4. begin
  5.   readln(text);
  6.   readln(s);
  7.   i := 1;
  8.   while i <= length(text) do
  9.   begin
  10.     if((i = 1) or (text[i - 1] = ' ')) and (text[i] = s[1]) then
  11.     begin
  12.       j := i;
  13.       while (j <= length(text)) and (text[j] <> ' ') do
  14.         j := j + 1;
  15.       delete(text, i, j - i);
  16.       insert(s, text, i);
  17.     end;
  18.     i := i + 1;
  19.   end;
  20.   writeln(text);
  21. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top