
25.12.2011, 12:30
|
Прохожий
|
|
Регистрация: 25.12.2011
Сообщения: 4
Репутация: 10
|
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
Edit2: TEdit;
BitBtn1: TBitBtn;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
M[1..x]: Array of integer;
i,n: integer;
a: integer;
k: integer;
begin
M:=StrToInt(Edit1.Text);
k:=0;
for i:=1 to n do
begin
a:=M[i];
if div(a)>0 then
k:=k+1;
end;
Edit2.Text:=k
end;
end.
Админ: Пользуемся тегами для оформления кода!
Полная ересь?
|