Let $n$ be a positive integer greater than $2$. Solve in nonnegative real numbers the following system of equations \[x_{k}+x_{k+1}=x_{k+2}^{2}\quad , \quad k=1,2,\cdots,n\] where $x_{n+1}=x_{1}$ and $x_{n+2}=x_{2}$.
1. **Summing the Equations:**
   Given the system of equations:
   \[
   x_k + x_{k+1} = x_{k+2}^2 \quad \text{for} \quad k=1,2,\cdots,n
   \]
   with the conditions \( x_{n+1} = x_1 \) and \( x_{n+2} = x_2 \), we sum all the equations:
   \[
   \sum_{k=1}^{n} (x_k + x_{k+1}) = \sum_{k=1}^{n} x_{k+2}^2
   \]
   Notice that each \( x_i \) appears exactly twice on the left-hand side:
   \[
   2 \sum_{k=1}^{n} x_k = \sum_{k=1}^{n} x_{k+2}^2
   \]
   By reindexing the right-hand side, we get:
   \[
   2 \sum_{k=1}^{n} x_k = \sum_{k=1}^{n} x_k^2
   \]

2. **Rewriting the Sum:**
   We can rewrite the equation as:
   \[
   \sum_{k=1}^{n} x_k^2 = 2 \sum_{k=1}^{n} x_k
   \]
   Subtracting \( 2 \sum_{k=1}^{n} x_k \) from both sides, we get:
   \[
   \sum_{k=1}^{n} (x_k^2 - 2x_k) = 0
   \]
   This can be factored as:
   \[
   \sum_{k=1}^{n} (x_k - 1)^2 = 0
   \]

3. **Analyzing the Sum of Squares:**
   Since the sum of squares is zero, each term in the sum must be zero:
   \[
   (x_k - 1)^2 = 0 \quad \text{for all} \quad k=1,2,\cdots,n
   \]
   Therefore:
   \[
   x_k = 1 \quad \text{for all} \quad k=1,2,\cdots,n
   \]

4. **Verification:**
   We need to verify if \( x_k = 1 \) for all \( k \) satisfies the original system of equations:
   \[
   x_k + x_{k+1} = x_{k+2}^2
   \]
   Substituting \( x_k = 1 \):
   \[
   1 + 1 = 1^2
   \]
   This simplifies to:
   \[
   2 = 1
   \]
   which is a contradiction. Therefore, \( x_k = 1 \) is not a solution.

5. **Considering Other Cases:**
   We need to consider the case where there exists \( a \) such that \( x_a \leq 1 \):
   \[
   x_a^2 = x_{a-1} + x_{a-2} \leq 1
   \]
   This implies:
   \[
   x_{a-1} \leq 1 \quad \text{and} \quad x_{a-2} \leq 1
   \]
   Continuing this logic, we find that \( x_i = 0 \) for all \( i \) is a possible solution.

6. **Considering All Numbers Greater Than One:**
   If all \( x_i > 1 \), let \( a \) be such that \( (x_a - 1)^2 \) is maximized. Then:
   \[
   2x_a \geq x_{a-1} + x_{a-2}
   \]
   By the Dirichlet Principle:
   \[
   (x_a - 1)^2 \geq 1 \quad \Rightarrow \quad x_a \geq 2
   \]
   Since:
   \[
   x_{a-2} + x_{a-1} = x_a^2 \geq 2x_a
   \]
   This implies:
   \[
   x_a^2 = 2x_a \quad \Rightarrow \quad x_a = 2
   \]
   Therefore, all \( x_i = 2 \) is a solution.

The final answer is \( \boxed{ x_i = 2 } \) for all \( i \).