求调!样例过但WA!
查看原帖
求调!样例过但WA!
1028403
封禁用户楼主2023/8/15 08:15

觉得没问题啊。。。样例过了。。。

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin >> t;
    while (t--) {
        int n, num;
        cin >> n >> num;
        int cnt = 0;
        long long mul = 1;
        for (int i = 1; i <= n; i++) {
            mul *= i;
        }
        while (mul != 0) {
            int t = mul % 10;
            if (t == num) cnt++;
            mul /= 10;
        }
        cout << cnt << endl;
    }
    return 0;
}

哪个 dalao 帮忙纠一下错绝对关

2023/8/15 08:15
加载中...