repeat解:
var count,a,b,c:integer;
begin
repeat
inc(count);
a:=count div 100;
b:=count div 10-a*10;
c:=count-a*100-b*10;
if a*a*a+b*b*b+c*c*c=count then writeln(count);
until count=999;
end.
while解自己改吧
while解:var count,a,b,c:integer;
begin
conut:=0;
while count<=999 do begin inc(count); a:=count div 100; b:=count div 10-a*10; c:=count-a*100-b*10; if a*a*a+b*b*b+c*c*c=count then writeln(count); end;
end.
(while后接的是单语句,先判断后执行..还要注意数据初始化)
var a,b,c:integer;
begin
for a:=1 to 9 do
for b:=0 to 9 do
for c:=0 to 9 do
if a*a*a+b*b*b+c*c*c=100*a+10*b+c then writeln(a,b,c);
end.
这是最简单的
用REPEAT?比较恶心,加点分我帮你做