一个关于(A^B)%C的程序问题
Input The input consist of three integers A,B,C; 1<= A <=10000; 1<= B <=10^9; 1<=C<=10000; three 0 sign the end of the input
Output
The output will be a single integer——(A^B)%C. For example,A=2,B=4,C=5, then the result is (2^4)%5 = (2*2*2*2)%5 = 1.
我就是感觉B太大了不好处理。
请各位指点应该怎么办得好,让我有个大致的思路来解决这道题。