| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 78376 | sh25_wangtaojie | 阶乘数码 | C++ | 解答错误 | 0 MS | 244 KB | 517 | 2025-12-26 15:42:40 |
#include <iostream> #include <vector> int countDigitInFactorial(int n, int digit) { int count = 0; for (int i = 1; i <= n; ++i) { int num = i; while (num > 0) { if (num % 10 == digit) ++count; num /= 10; } } return count; } int main() { int t; std::cin >> t; while (t--) { int n, digit; std::cin >> n >> digit; std::cout << countDigitInFactorial(n, digit) << std::endl; } return 0; }