Pascal. Вывод строк в другой файл
имеется текстовый файл из нескольких строк (скажем, не более 100 символов в строке). организовать вывод строк в другой файл в обратном порядке. Использовать память экономно - в качестве буфера в программе применить строку. ее длина должна быть заведомо меньше длины исходного файла. помогите плиз
|
Цитата:
Например, так (имена и адреса файлов поставьте, конечно, свои): Код:
Var файл in.txt: Friends, Romans, countrymen, lend me your ears; I come to bury Caesar, not to praise him. The evil that men do lives after them; The good is oft interred with their bones; So let it be with Caesar. The noble Brutus Hath told you Caesar was ambitious: If it were so, it was a grievous fault, And grievously hath Caesar answer'd it. Here, under leave of Brutus and the rest - For Brutus is an honourable man; So are they all, all honourable men - Come I to speak in Caesar's funeral. He was my friend, faithful and just to me: But Brutus says he was ambitious; And Brutus is an honourable man. He hath brought many captives home to Rome Whose ransoms did the general coffers fill: Did this in Caesar seem ambitious? When that the poor have cried, Caesar hath wept: Ambition should be made of sterner stuff: Yet Brutus says he was ambitious; And Brutus is an honourable man. You all did see that on the Lupercal I thrice presented him a kingly crown, Which he did thrice refuse: was this ambition? Yet Brutus says he was ambitious; And, sure, he is an honourable man. I speak not to disprove what Brutus spoke, But here I am to speak what I do know. You all did love him once, not without cause: What cause withholds you then, to mourn for him? O judgment! thou art fled to brutish beasts, And men have lost their reason. Bear with me; My heart is in the coffin there with Caesar, And I must pause till it come back to me. файл out.txt: And I must pause till it come back to me. My heart is in the coffin there with Caesar, And men have lost their reason. Bear with me; O judgment! thou art fled to brutish beasts, What cause withholds you then, to mourn for him? You all did love him once, not without cause: But here I am to speak what I do know. I speak not to disprove what Brutus spoke, And, sure, he is an honourable man. Yet Brutus says he was ambitious; Which he did thrice refuse: was this ambition? I thrice presented him a kingly crown, You all did see that on the Lupercal And Brutus is an honourable man. Yet Brutus says he was ambitious; Ambition should be made of sterner stuff: When that the poor have cried, Caesar hath wept: Did this in Caesar seem ambitious? Whose ransoms did the general coffers fill: He hath brought many captives home to Rome And Brutus is an honourable man. But Brutus says he was ambitious; He was my friend, faithful and just to me: Come I to speak in Caesar's funeral. So are they all, all honourable men - For Brutus is an honourable man; Here, under leave of Brutus and the rest - And grievously hath Caesar answer'd it. If it were so, it was a grievous fault, Hath told you Caesar was ambitious: So let it be with Caesar. The noble Brutus The good is oft interred with their bones; The evil that men do lives after them; I come to bury Caesar, not to praise him. Friends, Romans, countrymen, lend me your ears; |
спасибо огромное!!!
|
Цитата:
|
Часовой пояс GMT +4, время: 23:14. |
Powered by vBulletin® Version 4.5.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.