ign="justify">    
Результатом 
курсовой работы является созданная 
программа, которая работает с текстовым 
файлом.
ПЕРЕЧЕНЬ 
ССЫЛОК 
  - Галисеев 
  Г.В. Программирование в среде Delphi 7. Самоучитель
 
  - Шупрута В.В. 
  Delphi 2005. Учимся программировать, НТ ПРЕСС 
  ООО МОСКВА, – 352 с.
 
  - Самофалов 
  К.Г. Прикладная теория цифровых автоматов, 
  Киев, "Вища школа", 1987г.
 
Приложение А
Приложение 
Б
Листинг 
основной программы 
  - unit Unit1;
 
  - interface
 
  - uses
 
  - Windows, Messages, SysUtils, 
  Variants, Classes, Graphics, Controls, Forms,
 
  - Dialogs, StdCtrls;
 
 
  - Type
 
  - TForm1 = class(TForm)
 
  - GroupBox1: TGroupBox;
 
  - Button1: TButton;
 
  - Button2: TButton;
 
  - Button3: TButton;
 
  - Button4: TButton;
 
  - txt_source: TMemo;
 
  - dlg_open: TOpenDialog;
 
  - Button5: TButton;
 
  - dlg_save: TSaveDialog;
 
  - procedure Button2Click(Sender: 
  TObject);
 
  - procedure Button4Click(Sender: 
  TObject);
 
  - procedure Button1Click(Sender: 
  TObject);
 
  - procedure Button5Click(Sender: 
  TObject);
 
  - procedure Button3Click(Sender: 
  TObject);
 
  - private
 
  - { Private declarations 
  }
 
  - public
 
  - { Public declarations 
  }
 
  - end;
 
 
  - var
 
  - Form1: TForm1;
 
  - implementation
 
  - {$R *.dfm}
 
 
  - procedure TForm1.Button2Click(Sender: 
  TObject);
 
  - begin
 
  - Form1.Close();
 
  - end;
 
 
  - procedure TForm1.Button4Click(Sender: 
  TObject);
 
  - begin
 
  - txt_source.Clear();
 
  - end;
 
 
  - procedure TForm1.Button1Click(Sender: 
  TObject);
 
  - begin
 
  - if (dlg_open.Execute) 
  then
 
  - txt_source.Lines.LoadFromFile(dlg_open.FileName);
 
  - end;
 
 
  - procedure TForm1.Button5Click(Sender: 
  TObject);
 
  - var
 
  - x:integer;
 
  - s:String; sl:TStringList; 
  n,p:integer;
 
  - f:boolean;
 
  - words:TStringList;//Массив 
  количества слов в строке
 
  - words_len:TStringList;//Массив 
  длины последних слов строк
 
  - begin
 
  - //Создаем разделитель 
  слов и необходимые массивы
 
  - sl:=TStringList.Create;
 
  - words:=TStringList.Create;
 
  - words_len:=TStringList.Create;
 
  - sl.Delimiter:=' ';
 
  - p:=0;
 
  - f:=false;
 
  - //Проверяем 
  расположены ли слова по возврастанию
 
  - for x:=0 to txt_source.Lines.Count-1 
  do
 
  - begins:=txt_source.Lines[x];
 
  - sl.DelimitedText:=s;
 
  - p:=0;
 
  - //Массив количества 
  слов в строках
 
  - words.Add(IntToStr(sl.Count));
 
  - //Непосредственно 
  проверка на правильность возрастания
 
  - for n:=0 to sl.Count-1 
  do
 
  - begin
 
  - if length(sl.Strings[n])>=p 
  then
 
  - p:=length(sl.Strings[n])
 
  - else
 
  - begin
 
  - f:=true;
 
  - break;
 
  - end;
 
  - end;
 
  - if f then break;
 
  - words_len.Add(IntToStr(Length(sl.Strings[sl.Count-1])));
 
  - end;
 
 
  - if f then
 
  - begin
 
  - messageBox(Form1.Handle,'Слова 
  не расположены по возврастанию','',0);
 
  - exit;
 
  - end;
 
  - n:=0;
 
  - //Находим максимум 
  количества слов
 
  - for x:=0 to words.Count-1 
  do
 
  - if StrToInt(words.Strings[x])>n 
  then
 
  -  n:=StrToInt(words.Strings[x]);
 
  - for x:=0 to words.Count-1 
  do
 
  - if StrToInt(words.Strings[x])=n 
  then
 
txt_source.Lines[x]:='*'+txt_source.Lines[x]+'*';
  - n:=0;
 
  - //Находим максимум 
  длины слова
 
  - for x:=0 to words_len.Count-1 
  do
 
  - if StrToInt(words_len.Strings[x])>n 
  then n:=StrToInt(words_len.Strings[x]);
 
  - for x:=0 to words_len.Count-1 
  do
 
  - if StrToInt(words_len.Strings[x])=n 
  then
 
  - begin
 
  - txt_source.Lines[x]:='*'+txt_source.Lines[x]+'*';
 
  - end;
 
  - for x:=0 to txt_source.Lines.Count-1 
  do
 
  - begin
 
  - if x mod 2<>0 
  then
 
  - txt_source.Lines[x]:=IntToStr(x)+txt_source.Lines[x];
 
  - txt_source.Lines[x]:=txt_source.Lines[x]+words.Strings[x];
 
  - end;
 
  - end;
 
 
  - procedure TForm1.Button3Click(Sender: 
  TObject);
 
  - begin
 
  - if (dlg_save.Execute) 
  then
 
  - txt_source.Lines.SaveToFile(dlg_save.FileName+'.txt');
 
  - end;
 
  - end.
 
 
Приложение 
В
Результаты 
выполнения программы
Исходный 
файл
 
Результирующий 
файл.