Let $n$ be a fixed positive integer. To any choice of real numbers satisfying \[0\le x_{i}\le 1,\quad i=1,2,\ldots, n,\] there corresponds the sum \[\sum_{1\le i<j\le n}|x_{i}-x_{j}|.\] Let $S(n)$ denote the largest possible value of this sum. Find $S(n)$.
1. **Assume the order of \( x_i \):**
   Without loss of generality, we can assume that \( x_1 \leq x_2 \leq \cdots \leq x_n \). This assumption simplifies the calculation of the sum of absolute differences.

2. **Express the sum in terms of differences:**
   The sum of absolute differences can be written as:
   \[
   \sum_{1 \le i < j \le n} |x_i - x_j|
   \]
   Given the ordering \( x_1 \leq x_2 \leq \cdots \leq x_n \), the absolute value can be removed:
   \[
   \sum_{1 \le i < j \le n} (x_j - x_i)
   \]

3. **Rewriting the sum:**
   We can rewrite the sum by considering the contribution of each \( x_k \) in the sum:
   \[
   \sum_{1 \le i < j \le n} (x_j - x_i) = \sum_{k=1}^{n-1} k(n-k) (x_{k+1} - x_k)
   \]
   This is because each \( x_k \) appears in the sum \( k(n-k) \) times.

4. **Simplify the expression:**
   The above sum can be further simplified by considering the telescoping nature of the sum:
   \[
   \sum_{k=1}^{n-1} k(n-k) (x_{k+1} - x_k) = \sum_{k=1}^n (2k-n-1)x_k
   \]
   This is derived by expanding and rearranging the terms.

5. **Determine the values of \( x_k \):**
   To maximize the sum, we need to choose \( x_k \) such that the sum \( \sum_{k=1}^n (2k-n-1)x_k \) is maximized. This happens when:
   \[
   x_k = \begin{cases} 
   1 & \text{if } 2k - n - 1 \geq 0 \\
   0 & \text{otherwise}
   \end{cases}
   \]
   Solving \( 2k - n - 1 \geq 0 \) gives \( k \geq \frac{n+1}{2} \).

6. **Calculate the maximum sum:**
   The number of terms \( k \) that satisfy \( k \geq \frac{n+1}{2} \) is \( \left\lceil \frac{n}{2} \right\rceil \). The remaining terms are \( \left\lfloor \frac{n}{2} \right\rfloor \). Therefore, the maximum sum is:
   \[
   S(n) = \left\lfloor \frac{n}{2} \right\rfloor \left\lceil \frac{n}{2} \right\rceil
   \]

The final answer is \( \boxed{S(n) = \left\lfloor \frac{n}{2} \right\rfloor \left\lceil \frac{n}{2} \right\rceil} \).