#include<stdio.h> int main() { int n,b,f=1,i; scanf("%d %d",&n,&b); for(i=2;i<=n;i++) { f*=i; while(f%b==0) f/=b; f%=b; } printf("%d",f); return 0; }
Cow Brainiacs
原文:https://www.cnblogs.com/zzjam--1/p/11397142.html