欣乐

The eagles are coming!

导航

小学奥数读本(四年级),P18第8(3)题

小学奥数读本(四年级),P18第8(3)题。

 

 1 var
 2   i,j:longint;
 3   sa,sb:string;
 4   c:char;
 5 begin
 6   for i:=12345 to 98765 do begin
 7     str(i,sa);
 8     for j:=2 to 9 do begin
 9       str(i*j,sb);
10       if( i*j<99999 ) then begin
11         c:=sb[1]; sb[1]:=sb[5]; sb[5]:=c;
12         c:=sb[2]; sb[2]:=sb[4]; sb[4]:=c;
13         if(sa=sb) then writeln(i,'*',j,'=',i*j);
14       end;
15     end;
16   end;
17 end.
View Code

 

 

得:21978*4=87912。

 

 

posted on 2014-06-04 00:44  欣乐  阅读(171)  评论(0编辑  收藏  举报