题解 | #包含数字9的数#
包含数字9的数
https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
#include <stdio.h>
int main()
{
int i = 0;
int n = 0;
for(i = 1;i<=2019;i++)
{
int m = 0;
m = i;
while(m)
{
if(m%10==9)
{
n++;
break;
}
m = m/10;
}
}
printf("%d\n",n);
return 0;
}