To find the ratio of the number of students who want pancakes to the number of students who want waffles, we take the numbers of students who want each item:
- Students who want pancakes: 31
- Students who want waffles: 18
The ratio is written as:
\[ \text{Ratio} = \frac{\text{Number of students wanting pancakes}}{\text{Number of students wanting waffles}} = \frac{31}{18} \]
Thus, the ratio of students who want pancakes to those who want waffles is:
\[ 31:18 \]
So the correct answer is 31:18.