大部分最后的尾数都是0
My ugly code
#include <cstdio>
#include <cmath>
#define ll long long
using namespace std;
ll a,b;
int main(){
while(~scanf("%I64d%I64d",&a,&b)){
ll ans=1;
for(ll i=a+1;i<=b;i++){
ans*=(i%10);
ans=ans%10;
if(ans==0)
break ;
}
printf("%I64d\n",ans);
}
return 0;
}