编写程序统计1000
dim b(3) as Integer
for a = 1000 to 9999
c=sqr(a)
if c=int(c) then
b(0) = int(a/1000)
b(1) = int(a/100)-b(0)*10
b(2) = int(a/10)-b(1)*10 -b(0)*100
b(3) = a-b(2)*10-b(1)*100-b(0)*1000
if b(0)+b(2)=12 and b(1)+b(3)=24 then
print b(0)*1000+b(1)*100+b(2)*10+b(3)
end if
end if
next a。
 
;。
[展开]
program ab;
var a,b,t,i:integer;
begin
for i:=1000 to 9999 do
if (i mod 1000) + ((i mod 10)-(i mod 100)*10)=12 then
if ((i mod 100)-(i mod 1000)*10+(i - (i mod 10)*10)=24)
then writeln(i);
end。
。