嘛。。。。题目很水
直接取摸+去0就好了
#include<bits/stdc++.h>
using namespace std;
long long n,now=1,mod = 10000000;
int main(){
cin>>n;
for(long long i=1;i<=n;i++){
now = now*i;
while(now%10==0)now = now/10;
now = now%mod;
}
cout<<now%10<<endl;
}
嘛。。。。题目很水
直接取摸+去0就好了
#include<bits/stdc++.h>
using namespace std;
long long n,now=1,mod = 10000000;
int main(){
cin>>n;
for(long long i=1;i<=n;i++){
now = now*i;
while(now%10==0)now = now/10;
now = now%mod;
}
cout<<now%10<<endl;
}