Скачать 5.81 Kb.
|
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; StringGrid1: TStringGrid; Button5: TButton; procedure Button5Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1:TForm1; i, a, n: Integer; Sort: Boolean; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin StringGrid1.Cells[0,0]:='№'; StringGrid1.Cells[1,0]:='1'; StringGrid1.Cells[2,0]:='2'; StringGrid1.Cells[3,0]:='3'; StringGrid1.Cells[4,0]:='4'; StringGrid1.Cells[5,0]:='5'; StringGrid1.Cells[0,1]:='первый просмотр'; StringGrid1.Cells[0,2]:='второй просмотр'; StringGrid1.Cells[0,3]:='третий просмотр'; StringGrid1.Cells[0,4]:='четвертый просмотр'; StringGrid1.Cells[0,5]:='пятый просмотр'; StringGrid1.Cells[0,6]:='мгновенный расчет'; end; procedure TForm1.Button5Click(Sender: TObject); begin StringGrid1.Cells[1,6]:=StringGrid1.Cells[1,1]; StringGrid1.Cells[2,6]:=StringGrid1.Cells[2,1]; StringGrid1.Cells[3,6]:=StringGrid1.Cells[3,1]; StringGrid1.Cells[4,6]:=StringGrid1.Cells[4,1]; StringGrid1.Cells[5,6]:=StringGrid1.Cells[5,1]; Sort:=True; n:=0; while Sort do begin Sort:=False; for i:=1 to 5-1-n do if StrToInt(StringGrid1.Cells[i,6])>StrToInt(StringGrid1.Cells[i+1,6]) then begin Sort:=True; a:=StrToInt(StringGrid1.Cells[i,6]); StringGrid1.Cells[i,6]:=StringGrid1.Cells[i+1,6]; StringGrid1.Cells[i+1,6]:=IntToStr(a); end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin StringGrid1.Cells[1,2]:=StringGrid1.Cells[1,1]; StringGrid1.Cells[2,2]:=StringGrid1.Cells[2,1]; StringGrid1.Cells[3,2]:=StringGrid1.Cells[3,1]; StringGrid1.Cells[4,2]:=StringGrid1.Cells[4,1]; StringGrid1.Cells[5,2]:=StringGrid1.Cells[5,1]; Sort:=True; n:=0; for i:=1 to 5-1-n do if StrToInt(StringGrid1.Cells[i,2])>StrToInt(StringGrid1.Cells[i+1,2]) then begin Sort:=True; a:=StrToInt(StringGrid1.Cells[i,2]); StringGrid1.Cells[i,2]:=StringGrid1.Cells[i+1,2]; StringGrid1.Cells[i+1,2]:=IntToStr(a); end; end; procedure TForm1.Button2Click(Sender: TObject); begin StringGrid1.Cells[1,3]:=StringGrid1.Cells[1,1]; StringGrid1.Cells[2,3]:=StringGrid1.Cells[2,1]; StringGrid1.Cells[3,3]:=StringGrid1.Cells[3,1]; StringGrid1.Cells[4,3]:=StringGrid1.Cells[4,1]; StringGrid1.Cells[5,3]:=StringGrid1.Cells[5,1]; Sort:=True; for n:=0 to 1 do for i:=1 to 5-1-n do if StrToInt(StringGrid1.Cells[i,3])>StrToInt(StringGrid1.Cells[i+1,3]) then begin Sort:=True; a:=StrToInt(StringGrid1.Cells[i,3]); StringGrid1.Cells[i,3]:=StringGrid1.Cells[i+1,3]; StringGrid1.Cells[i+1,3]:=IntToStr(a); end; end; procedure TForm1.Button3Click(Sender: TObject); begin StringGrid1.Cells[1,4]:=StringGrid1.Cells[1,1]; StringGrid1.Cells[2,4]:=StringGrid1.Cells[2,1]; StringGrid1.Cells[3,4]:=StringGrid1.Cells[3,1]; StringGrid1.Cells[4,4]:=StringGrid1.Cells[4,1]; StringGrid1.Cells[5,4]:=StringGrid1.Cells[5,1]; Sort:=True; for n:=0 to 2 do for i:=1 to 5-1-n do if StrToInt(StringGrid1.Cells[i,4])>StrToInt(StringGrid1.Cells[i+1,4]) then begin Sort:=True; a:=StrToInt(StringGrid1.Cells[i,4]); StringGrid1.Cells[i,4]:=StringGrid1.Cells[i+1,4]; StringGrid1.Cells[i+1,4]:=IntToStr(a); end; end; procedure TForm1.Button4Click(Sender: TObject); begin StringGrid1.Cells[1,5]:=StringGrid1.Cells[1,1]; StringGrid1.Cells[2,5]:=StringGrid1.Cells[2,1]; StringGrid1.Cells[3,5]:=StringGrid1.Cells[3,1]; StringGrid1.Cells[4,5]:=StringGrid1.Cells[4,1]; StringGrid1.Cells[5,5]:=StringGrid1.Cells[5,1]; Sort:=True; for n:=0 to 3 do for i:=1 to 5-1-n do if StrToInt(StringGrid1.Cells[i,5])>StrToInt(StringGrid1.Cells[i+1,5]) then begin Sort:=True; a:=StrToInt(StringGrid1.Cells[i,5]); StringGrid1.Cells[i,5]:=StringGrid1.Cells[i+1,5]; StringGrid1.Cells[i+1,5]:=IntToStr(a); end; end; end. |
![]() | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms | ![]() | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms |
![]() | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms | ![]() | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms |
![]() | Операционные
системы
WINDOWS
95 и WINDOWS 98 Концепция, заложенная в основу Windows 95, полностью сохранена в Windows 98. Графический интерфейс также изменился незначительно.... | ![]() | Windows 7 Windows 7 Сервер коллегой Windows 7,Windows Server 2008 R2, была выпущена в то же время. Windows 7 сменяется Windows 8, которая была выпущена... |
![]() | Указатель на структуру типа wsadata, в которую будут записаны сведения о конкретной реализации интерфейса Windows Sockets. В случае успеха функция В процессе инициализации приложение должно зарегистрировать себя в библиотеке wsock32. Dll, которая предоставляет приложениям интерфейс... | ![]() | Примерный перечень вопросов для зачета по Операционным системам Основы работы в Windows; работа с мышью; клавиатура; элементы интерфейса; Windows; завершение работы с Windows; перетаскивание и... |
![]() | Установка Windows 7 на нетбуке с помощью флэш-накопителя usb при наличии установочного диска Windows 7 ... | ![]() | Avon predstavitel в списке найденных контактов выберите: Полное имя Если Вы устанавливаете Skype для Windows, то для работы Skype на Вашем компьютере должна быть установлена операционная система Windows... |
![]() | Инструкция пПрошивка телефона, с помощью Flashtool Драйвера (пользователям Windows 7 x64 нужно перед установкой драйверов выставить в свойствах файла совместимость с Windows Vista... |