c语言编程计算(a*b)%c

日期:2012-08-07 23:41:30 人气:1

c语言编程计算(a*b)%c

直接二分幂取模,so easy! #include int pow_mod(int a,int b,int c) { int t; if(b==0) return 1; if(b==1) return a%c; t=pow(a,b/2,c); t=t*t%c; if(b&1==1)
    A+
热门评论