Guest User

Untitled

a guest
Jun 13th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var
  2. f1,f2:TextFile;
  3. i,n,colonIndex:integer;
  4. s:string;
  5. c: char;
  6. begin
  7. ......................................
  8. begin
  9. while not Eof(f1) do begin
  10. Readln(f1,s);
  11. n := Length(s);
  12. colonIndex := Pos(':', s);
  13. if colonIndex > 0 then
  14. begin
  15. for i := (colonIndex + 1) to colonIndex + ((n - colonIndex) div 2) do
  16. begin
  17. c := s[i];
  18. s[i] := s[n - (i - colonIndex) + 1];
  19. s[n - (i - colonIndex) + 1] := c;
  20. end;
  21. end;
  22. end;
  23. Writeln(f2,s);
  24. end;
  25. ......................................
Add Comment
Please, Sign In to add comment