个位9的数目+十位9的数目
#include<stdio.h>
int main()
{
int num = 0;
int count = 0;
for (num = 1; num <= 100; num++)
{
if (num % 10 == 9) //个位9的个数
count++;
if (num / 10 == 9)//十位9的个数
count++;
}
printf("%d", count);
return 0;
}
个位9的数目+十位9的数目
#include<stdio.h>
int main()
{
int num = 0;
int count = 0;
for (num = 1; num <= 100; num++)
{
if (num % 10 == 9) //个位9的个数
count++;
if (num / 10 == 9)//十位9的个数
count++;
}
printf("%d", count);
return 0;
}