win7下提示错误
本帖最后由 cyrs 于 2014-11-18 11:59 编辑unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var odds,sum:integer;
begin
sum:=0;
odds:=1;
while odds<= strtoint(Edit1.Text) do
begin
sum:=sum+odds;
odds:=odds+2;
end;
Showmessage(inttostr(sum));
end;
procedure TForm1.Button2Click(Sender: TObject);
var odds,sum:integer;
begin
sum:=0;
odds:=1;
Repeat
sum:=sum+odds;
odds:=odds+2;
until odds > strtoint(Edit1.Text);
Showmessage(inttostr(sum));
end;
end.
提示什么??? 我可以运行啊,没问题啊 你检查下你的窗体事件和窗体的控件什么是否和代码里的匹配,表示我用你的代码能运行 看看,学学
页:
[1]