declare @a as int,@b as int,@c as int,@d as int
set @a=100
while @a<1000
begin
set @b=cast(substring(cast(@b as varchar(3)),1,1) as int)
set @c=cast(substring(cast(@c as varchar(3)),1,1) as int)
set @d=cast(substring(cast(@d as varchar(3)),1,1) as int)
if power(@b,3)+power(@c,3)+power(@d,3)=@a
begin
print @a
end
set @a=@a+1
end
如在这段代码中的cast,谢谢大家的帮忙
互换的青春
千巷猫影