#include<stdio.h>
#include<stdlib.h>

void NineNumber()
{
    int num = 1;
    int count = 0;
    int unit = 0;
    int ten = 0;
    int hundred = 0;

    for (; num <= 100; num++)
    {
        hundred = num / 100;
        ten = (num - hundred * 100) / 10;
        unit = (num - hundred * 100 - ten * 10) / 1;

        if (hundred == 9)
        {
            count++;
        }
        if (ten == 9)
        {
            count++;
        }
        if (unit == 9)
        {
            count++;
        }
    }
    printf("%d\n", count);
}

int main()
{
    NineNumber();
    system("pause");
    return 0;
}