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