Example 1 Given that $x, y, z$ are three non-negative real numbers, satisfying
$$
3 x+2 y+z=5, x+y-z=2 \text{. }
$$

If $S=2 x+y-z$, then the sum of the maximum and minimum values of $S$ is ( ).
(A) 5
(B) 6
(C) 7
(D) 8
(2008, National Junior High School Mathematics League Sichuan Preliminary)
Solve the system of equations $\left\{\begin{array}{l}3 x+2 y+z=5, \\ x+y-z=2 .\end{array}\right.$
The solution is $x=\frac{7-3 y}{4}, z=\frac{y-1}{4}$.
From the problem, we know
$$
x=\frac{7-3 y}{4} \geqslant 0, y \geqslant 0, z=\frac{y-1}{4} \geqslant 0 \text {. }
$$

Solving, we get $1 \leqslant y \leqslant \frac{7}{3}$.
Thus, $S=2 x+y-z=-\frac{3}{4} y+\frac{15}{4}$.
When $y=\frac{7}{3}$, $S$ has a minimum value of 2;
When $y=1$, $S$ has a maximum value of 3.
Therefore, the sum of the maximum and minimum values of $S$ is 5. Hence, the answer is A.