题解 | #包含数字9的数#
包含数字9的数
http://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d
#include<stdio.h>
int main(){
int one,ten,hundred,thousand,k=0;
for(int i=1;i<=2019;i++){
one = i%10;
ten = i/10%10;
hundred = i/100%10;
thousand = i/1000;
if(one==9||ten==9||hundred==9||thousand==9) k++;
}printf("%d\n",k);
}