题目:求1-100之间有多少个9
//1-100之间有多少个9
#include<stdio.h>
#include<stdlib.h>
int main()
{
int count = 0;
for (int i = 1; i <= 100; i++)
{
if (i % 10 == 9)
count++;
if (i / 10 == 9)
count++;
}
printf("共有%d个9\n", count);
system("pause");
return 0;
}