Advertisement
Arfizato

fassakh din ommo weld mohammed

Apr 10th, 2020
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.68 KB | None | 0 0
  1. //https://imgur.com/a/N3WCZ7C
  2. Program fassakhDinOmmou;
  3. uses WinCrt;
  4. var
  5.     s,t,rep : String;
  6. Procedure saisi(var s : String;ch: string);
  7.  var
  8.     a: Byte;
  9.  begin
  10.   repeat
  11.         write(ch,': ');
  12.          readln(s);
  13.          a:=1;
  14.         while (s[a] in ['a'..'z','#']) and (a<= Length( s)) do
  15.          a:=a+1;
  16.     Until a> Length(s);
  17.  end;
  18.  Function backspace(s: string): String;
  19.     begin
  20.         while pos('#',s) <> 0 do
  21.             if  pos('#',s) <>1 then
  22.                 delete(s,pos('#',s)-1,2)
  23.             else
  24.                 delete(s,pos('#',s),1)  ;
  25.         backspace:=s;
  26.     end;
  27. begin
  28. repeat
  29.      saisi(t,'T');
  30.      saisi(s,'S');
  31.      if backspace(s)=backspace(t) then
  32.       writeln('True')
  33.      else
  34.       writeln('False');
  35.     readln(rep);
  36.  until rep='o';
  37. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement