Created
March 18, 2013 12:47
-
-
Save tuankiet65/5186922 to your computer and use it in GitHub Desktop.
Cho dữ liệu trong file input.txt gồm số dòng không rõ, đảo ngược các dòng và xuất ra file ketqua.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program string_reverse; | |
uses crt; | |
var t, tout: text; | |
s, s2: widestring; | |
i: longint; | |
begin | |
clrscr; | |
assign(t, './input.txt'); | |
reset(t); | |
assign(tout, './ketqua.txt'); | |
rewrite(tout); | |
while not eof(t) do begin | |
readln(t, s); | |
for i:=length(s) downto 1 do s2:=s2+s[i]; | |
writeln(tout, s2); | |
s2:=''; | |
end; | |
close(t); | |
close(tout); | |
write('Xong'); | |
readkey; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment