4. For $S_{n}=\{1,2, \cdots, n\}$, we pick a non-empty subset $A$. We multiply each element $k(1 \leqslant k \leqslant n)$ in $A$ by $(-1)^{k}$ and then find the sum. The total sum of all these sums is . $\qquad$
4. $(-1)^{n}\left[n+\frac{1-(-1)^{n}}{2}\right] 2^{n-2}$

The problem can be transformed into finding the sum of all elements in all subsets of the set $\{-1,2,-3,4, \cdots, (-1)^{n} n\}$. Since in this total sum, each element appears $2^{n-1}$ times, we get
$$
\begin{aligned}
N & =\left[-1+2-3+4-\cdots+(-1)^{n} n\right] \cdot 2^{n-1} \\
& =[(-1+2)+(-3+4)+\cdots] \cdot 2^{n-1} \\
& =\left\{\begin{array}{ll}
\frac{n}{2} \cdot 2^{n+1}, & n \text { is even; } \\
\frac{-n-1}{2} \cdot 2^{n-1}, n \text { is odd. }
\end{array}\right.
\end{aligned}
$$

Combining, we get $N=(-1)^{n}\left[n+\frac{1-(-1)^{n}}{2}\right] \cdot 2^{n-2}$.