Let the integer $n \ge 2$ , and $x_1,x_2,\cdots,x_n $ be real numbers such that $\sum_{k=1}^nx_k$ be integer  . $d_k=\underset{m\in {Z}}{\min}\left|x_k-m\right| $, $1\leq k\leq n$ .Find the maximum  value of $\sum_{k=1}^nd_k$.
1. **Define the problem and variables:**
   Let \( n \ge 2 \) be an integer, and let \( x_1, x_2, \ldots, x_n \) be real numbers such that \( \sum_{k=1}^n x_k \) is an integer. Define \( d_k = \underset{m \in \mathbb{Z}}{\min} |x_k - m| \) for \( 1 \le k \le n \). We need to find the maximum value of \( \sum_{k=1}^n d_k \).

2. **Express \( d_k \) in terms of fractional parts:**
   Let \( \{x_i\} \) denote the fractional part of \( x_i \). Then \( \{x_i\} = x_i - \lfloor x_i \rfloor \). Note that \( d_k = \min(\{x_k\}, 1 - \{x_k\}) \).

3. **Analyze the range of \( d_k \):**
   Since \( 0 \le \{x_k\} < 1 \), we have \( 0 \le d_k \le \frac{1}{2} \).

4. **Case 1: \( n \equiv 0 \pmod{2} \):**
   - If \( n \) is even, we can set \( \{x_1\} = \{x_2\} = \cdots = \{x_n\} = \frac{1}{2} \). In this case, \( d_k = \frac{1}{2} \) for all \( k \), and thus:
     \[
     \sum_{k=1}^n d_k = n \cdot \frac{1}{2} = \frac{n}{2}
     \]
   - Since \( d_k \le \frac{1}{2} \) for all \( k \), the maximum value of \( \sum_{k=1}^n d_k \) is indeed \( \frac{n}{2} \).

5. **Case 2: \( n \equiv 1 \pmod{2} \):**
   - If \( n \) is odd, suppose there are exactly \( k \) elements \( \{x_1\}, \{x_2\}, \ldots, \{x_k\} \) that are less than \( \frac{1}{2} \). Then:
     \[
     \sum_{k=1}^n x_k = \frac{n}{2} + \sum_{i=k+1}^{n} \epsilon_i - \sum_{i=1}^{k} \epsilon_i
     \]
     where \( \epsilon_i = \{x_i\} \) if \( \{x_i\} < \frac{1}{2} \) and \( \epsilon_i = 1 - \{x_i\} \) if \( \{x_i\} \ge \frac{1}{2} \).
   - Since \( \sum_{k=1}^n x_k \) is an integer and \( \frac{n-1}{2} \in \mathbb{N} \), we have:
     \[
     \frac{1}{2} + \sum_{i=k+1}^{n} \epsilon_i - \sum_{i=1}^{k} \epsilon_i \in \mathbb{Z}
     \]
     This implies:
     \[
     \left| \sum_{i=k+1}^{n} \epsilon_i - \sum_{i=1}^{k} \epsilon_i \right| \ge \frac{1}{2}
     \]
   - Therefore:
     \[
     \sum_{i=1}^{n} \epsilon_i \ge \frac{1}{2}
     \]
   - Finally:
     \[
     \sum_{k=1}^n d_k = \frac{n}{2} - \sum_{i=1}^{n} \epsilon_i \le \frac{n}{2} - \frac{1}{2} = \frac{n-1}{2}
     \]
   - The maximum value of \( \sum_{k=1}^n d_k \) is indeed \( \frac{n-1}{2} \). An example is when \( x_1 = x_2 = \cdots = x_{n-1} = \frac{1}{2} \) and \( x_n = 0 \).

6. **Conclusion:**
   Combining both cases, the maximum value of \( \sum_{k=1}^n d_k \) is \( \left\lfloor \frac{n}{2} \right\rfloor \).

The final answer is \( \boxed{ \left\lfloor \frac{n}{2} \right\rfloor } \)