virushuo: 试试这个,没在慢的芯片上用过,反正我自己用还成 [阅读: 277] 2009-12-10 16:28:41 int calc(int a,int b,int c) { int ret=1; a%=c; while (true) { if (b&1) ret=(ret*a)%c; if (b>>=1) a=(a*a)%c; else break; } return ret; }