num=0;
for a=2:1:9
for b=2:1:9
for c=2:1:9
for d=2:1:9
if a^b*c^d==1000*a+100*b+10*c+d
num=num+1;
an(num,1)=a;
an(num,2)=b;
an(num,3)=c;
an(num,4)=d;
end
end
end
end
end
>> an
an =
2 5 9 2
>>
电脑算出来的可以么?
a=2,b=5,c=9,d=2
num=0;
for a=2:1:9
for b=2:1:9
for c=2:1:9
for d=2:1:9
if a^b*c^d==1000*a+100*b+10*c+d
num=num+1;
an(num,1)=a;
an(num,2)=b;
an(num,3)=c;
an(num,4)=d;
end
end
end
end
end
>> an
an =
2 5 9 2
>>
电脑算出来的可以么?
a=2,b=5,c=9,d=2