6. á¡ÂèÍÂ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
ÃËÑÊ·Õè 6-24  àÁ·çÍ´¤Ó¹Ç³¤èÒ ab mod m
  public static int powerMod(int a, int b, int m) {
    if (b == 0) return 1;
    int p = powerMod(a, b / 2, m);
    p = (p * p) % m;
    if (b % 2 == 1) p = (a * p) % m;
    return p;
  }
©2009 S.Prasitjutrakul