12.23 Try to find the integer solutions of the equation $x+y=x^{2}-x y+y^{2$.
(7th Moscow Mathematical Olympiad, 1941)
[Solution 1] The given equation can be transformed into
$$
x^{2}-(y+1) x+y^{2}-y=0 .
$$

If the equation has integer solutions, then its discriminant
$$
\begin{array}{c}
\Delta=(y+1)^{2}-4\left(y^{2}-y\right) \geqslant 0, \\
3 y^{2}-6 y-1 \leqslant 0, \\
\frac{6-4 \sqrt{3}}{6} \leqslant y \leqslant \frac{6+4 \sqrt{3}}{6}, \\
1-\frac{2}{3} \sqrt{3} \leqslant y \leqslant 1+\frac{2}{3} \sqrt{3} .
\end{array}
$$

Since $y$ is an integer, then $y=0,1,2$.
When $y=0$, the given equation becomes
$$
x=x^{2},
$$

solving for
$$
x=0 \text { or } x=1 \text {; }
$$

When $y=1$, the given equation becomes

solving for
$$
\begin{array}{c}
x^{2}-2 x=0, \\
x=0 \text { or } x=2 ;
\end{array}
$$

When $y=2$, the given equation becomes

solving for
$$
x^{2}-3 x+2=0 \text {, }
$$
$$
x=1 \text { or } x=2 \text {. }
$$

Thus, we obtain six sets of integer solutions:
$$
(x, y)=(0,0),(1,0),(0,1),(2,1),(1,2),(2,2) .
$$
[Solution 2] The given equation can be transformed into
$$
(x-1)^{2}+(y-1)^{2}+(x-y)^{2}=2
$$

form.
Thus, we can obtain the following system of equations:
$$
\left\{\begin{array} { l } 
{ ( x - 1 ) ^ { 2 } = 1 , } \\
{ ( y - 1 ) ^ { 2 } = 1 , } \\
{ ( x - y ) ^ { 2 } = 0 , }
\end{array} \quad \left\{\begin{array} { l } 
{ ( x - 1 ) ^ { 2 } = 1 , } \\
{ ( y - 1 ) ^ { 2 } = 0 , } \\
{ ( x - y ) ^ { 2 } = 1 , }
\end{array} \quad \left\{\begin{array}{l}
(x-1)^{2}=0, \\
(y-1)^{2}=1, \\
(x-y)^{2}=1 .
\end{array}\right.\right.\right.
$$

From the above, we can solve for
$$
(x, y)=(0,0),(1,0),(0,1),(2,1),(1,2),(2,2) .
$$