首页 > 其他 > 详细

luogu_1134 阶乘问题

时间:2017-10-07 17:00:48      阅读:266      评论:0      收藏:0      [点我收藏+]
#include <cstdio>
using namespace std;
int n;
long long ans=1;

int main(){
    scanf("%d",&n);
    for(register int i=1;i<=n;i++){
        ans*=i;
        while(ans%10==0)ans/=10;
        ans%=100000000;
    }
    printf("%lld\n",ans%10);
    return 0;
}

  

luogu_1134 阶乘问题

原文:http://www.cnblogs.com/codetogether/p/7634829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!