题解 | #[NOIP2013]记数问题#
[NOIP2013]记数问题
https://www.nowcoder.com/practice/28b2d9f2bf2c48de94a1297ed90e1732
#include <stdio.h> int main() { int s,i,x,count=0,u; scanf("%d %d",&s,&x); for(i=1;i<=s;i++){ u=i; while(u!=0){ if(u%10==x){ count++; u=u/10;} else u=u/10; }} printf("%d",count); return 0; }