Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
82450 sh25_shenpy 记数问题 C++ 通过 12 MS 256 KB 352 2026-01-13 21:36:06

Tests(10/10):


#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 ; }


测评信息: