统计0的个数: #include<iostream> using namespace std; int main(){ while(true){ int N,M; cin>>N>>M; int test=1; for(int i=1;i<=N;i++){ test=test*i; } int result=0; cout<<test<<endl; while(test!=0){ if(test>=M&&test%M==0){ result++; } else{ break; } test=test/M; } cout<<result; } return 0; }
点赞 5

相关推荐

合不合适,我自己说了才算
码农索隆:hr:“真执着啊,来我公司当法人吧”
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务