Find all pairs $(p,q)$ of real numbers such that $p+q=1998$ and the solutions of the equation $x^2+px+q=0$ are integers.
1. Given the quadratic equation \(x^2 + px + q = 0\) with integer solutions, we can express it as \((x + a)(x + b) = 0\), where \(a\) and \(b\) are integers.
2. Expanding \((x + a)(x + b)\), we get:
   \[
   x^2 + (a + b)x + ab = 0
   \]
   Comparing this with \(x^2 + px + q = 0\), we identify:
   \[
   p = a + b \quad \text{and} \quad q = ab
   \]
3. We are also given that \(p + q = 1998\). Substituting \(p = a + b\) and \(q = ab\) into this equation, we get:
   \[
   a + b + ab = 1998
   \]
4. Rearranging the equation, we have:
   \[
   ab + a + b + 1 = 1999
   \]
   This can be factored as:
   \[
   (a + 1)(b + 1) = 1999
   \]
5. Since 1999 is a prime number, it has only two positive divisors: 1 and 1999. Therefore, the pairs \((a + 1)\) and \((b + 1)\) can be:
   \[
   (a + 1, b + 1) = (1, 1999) \quad \text{or} \quad (a + 1, b + 1) = (1999, 1)
   \]
   Additionally, considering negative divisors:
   \[
   (a + 1, b + 1) = (-1, -1999) \quad \text{or} \quad (a + 1, b + 1) = (-1999, -1)
   \]
6. Solving for \(a\) and \(b\) in each case:
   - For \((a + 1, b + 1) = (1, 1999)\):
     \[
     a + 1 = 1 \implies a = 0 \quad \text{and} \quad b + 1 = 1999 \implies b = 1998
     \]
   - For \((a + 1, b + 1) = (1999, 1)\):
     \[
     a + 1 = 1999 \implies a = 1998 \quad \text{and} \quad b + 1 = 1 \implies b = 0
     \]
   - For \((a + 1, b + 1) = (-1, -1999)\):
     \[
     a + 1 = -1 \implies a = -2 \quad \text{and} \quad b + 1 = -1999 \implies b = -2000
     \]
   - For \((a + 1, b + 1) = (-1999, -1)\):
     \[
     a + 1 = -1999 \implies a = -2000 \quad \text{and} \quad b + 1 = -1 \implies b = -2
     \]
7. Calculating \(p\) and \(q\) for each pair \((a, b)\):
   - For \((a, b) = (0, 1998)\):
     \[
     p = a + b = 0 + 1998 = 1998 \quad \text{and} \quad q = ab = 0 \cdot 1998 = 0
     \]
   - For \((a, b) = (1998, 0)\):
     \[
     p = a + b = 1998 + 0 = 1998 \quad \text{and} \quad q = ab = 1998 \cdot 0 = 0
     \]
   - For \((a, b) = (-2, -2000)\):
     \[
     p = a + b = -2 - 2000 = -2002 \quad \text{and} \quad q = ab = (-2) \cdot (-2000) = 4000
     \]
   - For \((a, b) = (-2000, -2)\):
     \[
     p = a + b = -2000 - 2 = -2002 \quad \text{and} \quad q = ab = (-2000) \cdot (-2) = 4000
     \]

Therefore, the solutions are:
\[
\boxed{(1998, 0), (-2002, 4000)}
\]