设工地原有沙子X吨
(X-45)(1-40%)=45+(X-45)*40%
(X-45)*0.6=45+(X-45)*0.4
0.6X-27=45+0.4X-18
0.2X=54
X=270
答:工地原有沙子270吨.