主题:Delphi初学者
procedure TForm1.btnJudgeClick(Sender: TObject);
var
ANum, i, j, k:Integer;
begin
try
ANum := StrtoInt(edtNum.Text);
i := ANum Mod 10;
j := ANum Mod 100 div 10;
k := ANum div 100;
if i*i*i+j*j*j+k*k*k = ANum then
showMessage('是水仙花数')
else
showMessage('不是水仙花数');
except
begin
edtNum.Text := '';
showMessage('输入有误!');
end;
end;
end.
有三个错误:
';'excepted but '.' found
Declaration excepted but end of file found
Could not compile used unit 'lab0202.pas'
为什么啊请教一下???
var
ANum, i, j, k:Integer;
begin
try
ANum := StrtoInt(edtNum.Text);
i := ANum Mod 10;
j := ANum Mod 100 div 10;
k := ANum div 100;
if i*i*i+j*j*j+k*k*k = ANum then
showMessage('是水仙花数')
else
showMessage('不是水仙花数');
except
begin
edtNum.Text := '';
showMessage('输入有误!');
end;
end;
end.
有三个错误:
';'excepted but '.' found
Declaration excepted but end of file found
Could not compile used unit 'lab0202.pas'
为什么啊请教一下???