18. Let $x_{1}, x_{2}, \cdots, x_{n}$ and $a_{1}, a_{2}, \cdots, a_{n}$ be two sets of arbitrary real numbers $(n \geqslant 2)$ satisfying the conditions: $1^{\circ} . \sum_{i=1}^{n} x_{i}=0$; $2^{\circ} . \sum_{i=1}^{n}\left|x_{i}\right|=1 ; 3^{\circ} . a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{n}$. Try to find the minimum value of $A$ such that the inequality $\left|\sum_{i=1}^{n} a_{i} x_{i}\right| \leqslant A\left(a_{1}-a_{n}\right)$ holds.
18. From conditions $1^{\circ}$ and $2^{\circ}$, we know that $2\left|\sum_{i=1}^{k} x_{i}\right|=\left|\sum_{i=1}^{k} x_{i}\right|+\left|\sum_{i=k+1}^{n} x_{i}\right| \leqslant \sum_{i=1}^{n}\left|x_{i}\right|=1$, thus $\left|\sum_{i=1}^{k} x_{i}\right| \leqslant \frac{1}{2} \quad(k=1,2, \cdots, n-1)$.

From condition $3^{\circ}$, we have $a_{k}-a_{k+1} \geqslant 0(1 \leqslant k \leqslant n-1)$. Therefore, by Abel's identity and conditions $1^{\circ}$ and $3^{\circ}$, we have
$$
\begin{aligned}
\left|\sum_{i=1}^{n} a_{i} x_{i}\right| & =\left|\sum_{k=1}^{n-1}\left(\sum_{i=1}^{k} x_{i}\right)\right|\left(a_{k}-a_{k+1}\right) \leqslant \sum_{k=1}^{n-1}\left|\sum_{i=1}^{k} x_{i}\right|\left(a_{k} a_{k+1}\right) \\
& \leqslant \frac{1}{2} \sum_{k=1}^{n-1}\left(a_{k}-a_{k+1}\right)=\frac{1}{2}\left(a_{1}-a_{n}\right), \text{ hence } A_{\min } \leqslant \frac{1}{2} .
\end{aligned}
$$

When $x_{1}=-x_{n}=\frac{1}{2}$, and $x_{2}=x_{3}=\cdots=x_{n-1}=0$, the equality holds, i.e., $\left|\sum_{i=1}^{n} a_{i} x_{i}\right|=\frac{1}{2}\left(a_{1}-a_{n}\right)$. Therefore, the minimum value of $A$ is $\frac{1}{2}$.
In the above formula, let $a_{i}=\frac{1}{2}(i=1,2, \cdots, n)$, which is the problem from the 1989 National High School Mathematics Competition.