Will and 99 Honda civic lx sedan engine fit in a 99 Honda civic ex coupe?

I recently crashed my Honda civic lx and busted the whole frame. The body shops estimated $2,500-$3,500 to fix the damage. I found someone on craigslist selling a 99 civic ex coupe but the motor is messed up so their selling it for $1000 if I were to buy it would I be able to switch my 99 civic lx engine to the 99 civic ex model without any major complications or modifications?

Yup, perfectly.

They both have the same engine D13B4 so yes it'll fit without any modification. $1,000 for a car with major engine problem is kind little "stiff". I've found one at Texas for $700, the engine block has a hole on the side.