找规律,如果找不出来就直接计算,结果要对MOD取余
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int MOD=1e9;
int g[20][20];
int ans;
void sovel()
{
for(int i=0;i<10;i++)
{
for(int j=0;j<10;j++)
{
cin>>g[i][j];
}
}
LL sum=1;
//开始求所有数的乘积
for(int i=0;i<10;i++)
{
for(int j=0;j<10;j++)
{
sum=(sum*g[i][j])%MOD;
while(sum%10==0)
{
ans++;
sum/=10;
}
}
}
cout<<ans<<endl;
}
int main()
{
cin.tie(nullptr)->sync_with_stdio(false);
sovel();
return 0;
}