| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 91302 | sh25_zhangyj | 记数问题 | C++ | 通过 | 11 MS | 248 KB | 352 | 2026-06-12 15:28:54 |
#include <bits/stdc++.h> using namespace std ; int a[10] ; int cnt = 0 ; int n , x ; void func(int n ) { int m = n ; while(m) { if(m % 10 == x) cnt++ ; m /= 10 ; } } int main() { cin >> n >>x ; for(int i = 1 ; i <= n ; i++ ) func(i) ; cout << cnt << endl ; return 0 ; }