1. Person A and Person B are standing by the railway waiting for a train. It is known that the train is moving at a constant speed. At a certain moment, when the front of the train passes them, A starts walking in the same direction as the train at a constant speed, while B walks in the opposite direction at the same speed. When the rear of the train passes either of them, that person stops moving. In the end, A walked 45 meters, and B walked 30 meters. Find the total length of the train.
1. Notice that, A walks $45-30=15$ meters more than B. When A walks these 15 meters, the train travels $45+30=$ 75 meters, thus, the speed of the train is $\frac{75}{15}=5$ times the walking speed of a person.

When B walks these 30 meters, the train travels $30 \times 5=150$ meters (when the front of the train passes B, B starts walking, and when the rear of the train passes B, B stops walking).

Since B and the train are moving in opposite directions, the total length of the train is $150+30=180$ meters.