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