急求大神解答,在线等。判断一个数能否被3和5整除。
delphi吧
全部回复
仅看楼主
level 1
小梦_嗯哼 楼主
如图。感谢大神帮忙,把代码写一下。谢谢[乖][乖]
2014年10月20日 06点10分 1
level 1
小梦_嗯哼 楼主
刚刚忘了说,是用delphi7编写[乖][乖]
2014年10月20日 06点10分 2
吧务
level 14
作业自己做
2014年10月20日 06点10分 3
level 12
请问什么叫整除先?!
2014年10月20日 08点10分 4
level 9
我会,不过我躺床上了,不急的话明天写给你
——那么问题来了!
2014年10月20日 14点10分 5
问题就是:楼主给多少钱,层主才会不急。
2014年11月27日 01点11分
level 3
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (key in [*0*..*9*,*.*,#8]) then
key:=#0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
n,m:real;
i:string;
begin
i:=Edit1.Text;
n:=strtofloat(i)/3;
m:=strtofloat(i)/5;
if (pos(*.*,Floattostr(n))=0) and (pos(*.*,Floattostr(m))=0) then
showmessage(*该数可以同时被3,5整除*);
if (pos(*.*,Floattostr(n))=0) and (pos(*.*,Floattostr(m))<>0) then
showmessage(*该数只能被3整除*);
if (pos(*.*,Floattostr(n))<>0) and (pos(*.*,Floattostr(m))=0) then
showmessage(*该数只能被5整除*);
if (pos(*.*,Floattostr(n))<>0) and (pos(*.*,Floattostr(m))<>0) then
showmessage(*该数都不能被3,5整除*);
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
if strtoint(edit1.Text)>100 then
begin
showmessage(*程计100*);
edit1.Text:=*100*;
end
end;
还有个DVI函数也可以实现 DVI返回result.quot 是商 , result.rem是余数 可以判断余数为0 去调用
2014年10月21日 08点10分 8
这才是交流啊,连输入字符限制都替楼主考虑了。
2014年11月25日 21点11分
回复 szruis :这不是交流,是喂饭呢。
2014年11月26日 13点11分
回复 BambooCaep :我觉得是输液,连嚼都省了。
2014年11月26日 16点11分
层主爱心泛滥,就是传说中的圣母啊。
2014年11月27日 01点11分
level 14
mod
2017年03月12日 08点03分 9
level 9
mod
2017年03月12日 21点03分 10
1