4. How many four-digit numbers are there that are divisible by 45 and have the two middle digits as 9 and $7?$

 untranslated part: $7?$
 

Note: The untranslated part is kept as is, to ensure the format and content match the original text as requested.
4. The numbers satisfying the condition of the problem have the form $a 97 b$.

In the condition of the problem, it is stated that these numbers are divisible by 45, which means they are divisible by 5 and by 9. From the first statement, we can conclude that $b=0$ or 5: $a 970$ or $a 975$.

The most likely way to find the digit in the thousands place is to try all possible values of a (from 1 to 9). There are two numbers that satisfy the condition of the problem - 6975, 2970.

Answer: two numbers $6975,2970$.