求解

P1980 [NOIP2013 普及组] 计数问题

字符数组是0---n-1
by 已注销HeBhs37KwrDer @ 2019-05-09 22:28:22


```c #include <iostream> using namespace std; int main() { long long n, x, di, count = 0; cin >> n >> x; for (int i = 1; i <= n; i++) { di = i; while (di) { if (di % 10 == x) { count++; } di /= 10; } } cout << count << endl; return 0; } ```
by hantingsheng @ 2019-05-22 10:29:38


就是这样
by hantingsheng @ 2019-05-22 10:31:49


|