小学奥数读本(三年级),P133第13题
小学奥数读本(三年级),P133第13题。
用一到九,九个数,组成一道除法算式:口口口口×口=口口口口
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 var 2 i,j,k:longint; 3 s:set of 0..9; 4 begin 5 for i:=1234 to 9876 do 6 for j:=2 to 9 do begin 7 s:=[]; 8 s += [j]; 9 k:=i; 10 while(k>0) do begin 11 s += [k mod 10]; 12 k := k div 10; 13 end; 14 if( (i*j>=1234) and (i*j<=9876) ) then begin 15 k:=i*j; 16 while(k>0) do begin 17 s += [k mod 10]; 18 k := k div 10; 19 end; 20 end; 21 if( s = [1..9] ) then writeln(i,' ',j,' ',i*j); 22 end; 23 end.
两个解:
1738*4=6952
1963*4=7852