#include<stdio.h>
#include<stdlib.h>
int main()
{
int i = 0;
int count = 0;
while( i<= 100)
{
if (i % 10 == 9 ||((i%100)/10)==9)
{
count++;
}
i++;
}
printf("9出现的次数:%d\n",count);
system("pause");
return 0;
}
数一下 1到 100 的所有整数中出现多少次数字9。
猜你喜欢
转载自blog.csdn.net/qq_43857558/article/details/84889150
今日推荐
周排行