设男生有x人,则女生有(x-40)人,
2/3x=3/4(x-40)
2/3x=3/4x-30
9/12x-30=8/12x
1/12x=30
x=360
x-40=360-40=320
共有360+320=680(人)