設(shè)同學(xué)人數(shù)為x,搬磚總數(shù)為y。根據(jù)題意可以列出以下兩個(gè)方程:
1. 每人搬18塊,余24塊:
\[ y = 18x + 24 \]
2. 每人搬20塊,剩余2人沒(méi)磚搬:
\[ y = 20(x - 2) \]
將方程1代入方程2:
\[ 18x + 24 = 20(x - 2) \]
\[ 18x + 24 = 20x - 40 \]
\[ 24 + 40 = 20x - 18x \]
\[ 64 = 2x \]
\[ x = 32 \]
然后將x代入方程1求y:
\[ y = 18 \times 32 + 24 = 576 + 24 = 600 \]
所以,一共有32人,共搬600塊磚.