C++ 代码
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
const int M = 30;
using namespace std;
ll hp[N];
ll dis[N];
int main()
{
int n;
cin>>n;
ll ans=1;
for(int i=1;i<=n;i++){
ans*=i;
while(ans%10==0) ans/=10;
ans%=1000;
}
cout<<ans%10<<endl;
return 0;
}
又偶遇你了