Guest User

Untitled

a guest
Oct 13th, 2019
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program z;
  2.  
  3. var
  4. a,b : char;
  5. fl : boolean;
  6. begin
  7. fl := FALSE;
  8. read(a,b);
  9. if b = '.' then write(a)
  10. else
  11. begin
  12. if not((a = 'p') and (b = 'h')) then write(a);
  13.  
  14. while ((a <> '.') and (b <> '.')) do
  15. begin
  16. if (a = 'p') and (b = 'h') then
  17. begin
  18. write('f');
  19. read(b);
  20. fl:=TRUE;
  21. end
  22. else
  23. write(b);
  24. a:=b;
  25. read(b);
  26. if (fl = TRUE) then
  27. begin
  28. if (b = '.') then
  29. write(a);
  30. fl := FALSE;
  31. end;
  32. end;
  33. writeln;
  34. end;
  35. end.
RAW Paste Data