First we define the variable
Use for loop to find numbers within 100
Then judge the various situations where 9 appears
9,19,29,39,49,59,69,79,89,90,91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 ,99
The ones place is 9, or the tens place is 9
code show as below: