unit Unit7; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Imaging.jpeg; type TForm7 = class(TForm) Label1: TLabel; Edit1: TEdit; Button1: TButton; Button2: TButton; Label2: TLabel; Label3: TLabel; Label4: TLabel; Panel1: TPanel; Image1: TImage; Image2: TImage; Label5: TLabel; Label6: TLabel; Label7: TLabel; procedure FormCreate(Sender: TObject); function Labele:string; function DumIII:integer; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form7: TForm7; implementation var i,k,c,x,y,ball:integer;z:real; a:array[1..12] of integer; {$R *.dfm} procedure TForm7.FormCreate(Sender:TObject); begin c:=1; randomize; a[1]:=random(12)+1; for i:=2 to 12 do begin a[i]:=random(12)+1; k:=0; while k<>i-1 do begin k:=k+1; if a[i]=a[k] then begin k:=1; repeat a[i]:=random(12)+1; until a[i]<>a[k]; end; end; end; Labele; //r i := 1 to 12 do Label4.Caption:=Label4.Caption+' '+InttoStr(a[i]); Label3.Caption:='Вопрос номер '+InttoStr(c); Label4.Caption:='Вы набрали '+InttoStr(ball)+' баллов'; end; function TForm7.Labele; begin if (a[c]=1)or(a[c]=2)or(a[c]=3) then begin Label1.Caption:='Чему равна разность?'; DumIII; randomize; end; if (a[c]=4)or(a[c]=5)or(a[c]=6) then begin Label1.Caption:='Чему равна сумма?'; DumIII; randomize; end; if (a[c]=7)or(a[c]=8)or(a[c]=9) then begin Label1.Caption:='Чему равно произведение?'; DumIII; randomize; end; if (a[c]=10)or(a[c]=11)or(a[c]=12) then begin Label1.Caption:='Чему равно среднее арифмитическое?'; DumIII; randomize; end; end; procedure TForm7.Button1Click(Sender: TObject); begin close; end; procedure TForm7.Button2Click(Sender: TObject); begin if StrtoFloat(Edit1.Text)=z then ball:=ball+1; if c=12 then begin Label3.Caption:='Правильных ответов :'+InttoStr(ball); if (12-ball)=0 then Label4.Caption:='Отлично' else if ((12-ball)=1) or ((12-ball)=2) then Label4.Caption:='Хорошо' else if ((12-ball)=3) or ((12-ball)=4) then Label4.Caption:='Удовлетворительно' else Label4.Caption:='Неудовлетворительно'; Edit1.Text:=''; Button2.Enabled:=false; end else begin Edit1.Text:=''; c:=c+1; Label3.Caption:='Вопрос номер '+InttoStr(c); Label4.Caption:='Вы набрали '+InttoStr(ball)+' баллов'; Labele; end; end; function TForm7.DumIII; begin randomize; x:=random(500)+1; y:=random(500)+1; if (a[c]=1)or(a[c]=2)or(a[c]=3) then begin if y>x then begin z:=y-x; Label2.Caption:=InttoStr(y)+'-'+InttoStr(x); end else begin z:=x-y; Label2.Caption:=InttoStr(x)+'-'+InttoStr(y); end; end; if (a[c]=4)or(a[c]=5)or(a[c]=6) then begin z:=y+x; Label2.Caption:=InttoStr(y)+'+'+InttoStr(x); end; if (a[c]=7)or(a[c]=8)or(a[c]=9) then begin z:=y*x; Label2.Caption:=InttoStr(y)+'*'+InttoStr(x); end; if (a[c]=10)or(a[c]=11)or(a[c]=12) then begin z:=(y+x)/2; Label2.Caption:=InttoStr(y)+' и '+InttoStr(x); end; end; end.