?? unit1.pas
字號(hào):
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Panel1: TPanel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Label4: TLabel;
procedure FormClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClick(Sender: TObject);
var
x,y,m,n,i,j,k:integer;
p,q:real;
s:string;
begin
if edit1.Text='' then edit1.Text:='6';
n:=strtoint(edit1.Text);
x:=0;y:=0;i:=2;j:=2;
for i:=1 to n do
begin
m:=n-i;
p:=strtofloat(inttostr(i));
q:=strtofloat(inttostr(m));
while(j<=sqrt(p))and(x=0)do
if i mod j=0 then x:=1;
while(k<=sqrt(q))and(y=0)do
if m mod k=0 then y:=1;
if (x=0)and(y=0)then
label3.Caption:=edit1.Text+'='+inttostr(i)+'+'+inttostr(m);
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -