Text13. Дан непустой текстовый файл. Удалить из него первую строку.
Решение:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
program Text13; var F_in,F_out: Text; Name,line: string; begin Write('File name: '); Readln(Name); Assign(F_in,Name); Assign(F_out,'~'+Name); Reset(F_in); Rewrite(F_out); Readln(F_in,line); While not eof(F_in) do begin Readln(F_in,line); Writeln(F_out,line); end; Close(F_in); Close(F_out); Erase(F_in); Rename(F_out,Name); end. |
Другие задачи из раздела Text можно посмотреть здесь.
Комментарии: