#include<stdio.h>
int main()
{
int i;
int num;
int temp;
int count = 0;
printf("please input a number:\n");
scanf("%d",&num);
for(i = 1;i <= num;i++)
{
temp = i;
while(temp != 0)
{
if(temp % 10 == 9)
{
count++;
}
temp = temp / 10;
}
}
printf("%d\n",count);
return 0;
}
int main()
{
int i;
int num;
int temp;
int count = 0;
printf("please input a number:\n");
scanf("%d",&num);
for(i = 1;i <= num;i++)
{
temp = i;
while(temp != 0)
{
if(temp % 10 == 9)
{
count++;
}
temp = temp / 10;
}
}
printf("%d\n",count);
return 0;
}