Код (Text): int xxx(int a, int b, int c) { int result = 1; int t = a; int x = b; while (x > 0) { if (x & 1) { result = (result * t) % c; } x >>= 1; t = (t * t) % c; } return result; }