Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- {$mode objfpc}{$H+}
- interface
- uses
- Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
- type
- { TForm1 }
- TForm1 = class(TForm)
- Button1: TButton;
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Edit4: TEdit;
- Edit5: TEdit;
- Edit6: TEdit;
- Edit7: TEdit;
- Label1: TLabel;
- Label10: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Memo1: TMemo;
- Memo2: TMemo;
- procedure Button1Click(Sender: TObject);
- procedure Memo1Change(Sender: TObject);
- procedure Memo2Change(Sender: TObject);
- private
- { private declarations }
- public
- { public declarations }
- end;
- var
- Form1: TForm1;
- nmax,nmin,k,kd,i:Integer;
- a:array [1..10] of real;
- max,min,s:real;
- implementation
- {$R *.lfm}
- { TForm1 }
- procedure TForm1.Memo2Change(Sender: TObject);
- begin
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- s:=0; k:=0; kd:=0; max:=a[1];
- for i:=1 to 10 do
- begin
- a[i]:=StrToFloat(Memo2.Lines[i-1]);
- s:=s+a[i];
- if a[i]>=10 then k:=k+1;
- if (a[i]>=7) and (a[i]<10)then kd:=kd+1;
- if max<a[i] then
- begin
- max:=a[i];nmax:=i;
- end
- end;
- min:=a[1];
- for i:=1 to 10 do
- begin
- if min>a[i] then
- begin
- min:=a[i]; nmin:=i;
- end;
- end;
- Edit1.Text:=FloatToStrf(s/10,ffgeneral,1,2);
- Edit2.Text:=IntToStr(k);
- Edit3.text:=IntToStr(kd);
- Edit4.Text:=FloatToStr(max);
- Edit5.Text:=FloatToStr(min);
- Edit6.Text:=Memo1.Lines[nmax-1];
- Edit7.Text:=Memo1.Lines[nmin-1];
- end;
- procedure TForm1.Memo1Change(Sender: TObject);
- begin
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement