fork download
  1. program ideone;
  2.  
  3. uses SysUtils;
  4.  
  5. var I,P:Integer;
  6. var Str,Add,Left:String;
  7.  
  8. begin
  9. while true do
  10. begin
  11. ReadLn(Str);
  12. if Length(Str)<=0 then Exit;
  13. Add:=' =';
  14. P:=Pos('|',Str);
  15. if P<=0 then Continue;
  16. Left:=Copy(Str,1,P-1);
  17. while P<Length(Str) do
  18. begin
  19. Inc(P);
  20. Add:=Add+' '+IntToStr(Pos(Str[P],Left));
  21. end;
  22. WriteLn(Str+Add);
  23. end;
  24. end.
Success #stdin #stdout 0s 388KB
stdin
abcdef|af
dkijxc|xc
stdout
abcdef|af = 1 6
dkijxc|xc = 5 6