全wa
  • 板块P1591 阶乘数码
  • 楼主ld_k_s
  • 当前回复1
  • 已保存回复1
  • 发布时间2020/10/27 21:00
  • 上次更新2023/11/5 09:43:00
查看原帖
全wa
106795
ld_k_s楼主2020/10/27 21:00
#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		int n, a, c = 0;
		cin >> n >> a;
		long long s = 1;
		for (int j = 1; j <= n; j++) {
			s *= j;
		}
		while (s != 0) {
			if (s % 10 == a) {
				c++;
			}
			s /= 10;
		}
		cout << c << endl;
	}
	return 0;
}
2020/10/27 21:00
加载中...