Doing her homework Jane evaluated xy as a concatenation of two 3-digit numbers instead of a product x*y, thus obtaining a result n times bigger than the correct one.
Knowing that n is an integer find all possible solutions fitting the above fact.
143143 20449 7
167334 55778 3
rabbit-3:~ lord$ more jane.f
program jane
implicit none
integer x,y,xy,xty,n
do x=100,999
do y=100,999
xy=1000*x+y
xty=x*y
n=xy/xty
if(n*xty.eq.xy)print*,xy,xty,n
enddo
enddo
end
Edited on February 6, 2019, 8:09 am