unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    Edit4: TEdit;
    Button3: TButton;
    Edit3: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  close;
end;

var

   C:array of integer;
   i,n,m:integer;
procedure TForm1.Button3Click(Sender: TObject);

begin
    Edit4.Text:='';
    if Edit1.text='' then
                                 begin
                                 ShowMessage('ВВедите количество N');
                                 Exit;
                                 end;

    n:=StrToInt(Edit1.text);
    SetLength(C,n);

    Randomize;
    for i:=0 to n-1 do
                      begin
                        C[i]:=Random(10)-5;

                       Edit4.Text:=Edit4.text+FloatToStr(C[i])+' ';
                      end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var     i:integer;
begin
  edit3.Clear;
for i:=0 to n-1 do
   REPEAT
      if (Odd(C[i])) then found:=true
      else i:=i+1;
     UNTIL (i>n) or (found = true);
end;

end.
