acwing 89. a^b
题目
求 
输入格式
三个整数 
输出格式
输出一个整数,表示a^b mod p的值。
数据范围
0≤a,b≤1090≤a,b≤109 1≤p≤1091≤p≤109
输入样例:
3 2 7
输出样例:
#includeusing namespace std; typedef long long LL; int main() { int a,b,p; scanf("%d%d%d",&a,&b,&p); int res=1%p; while(b) { if(b&1) res=(LL)res*a%p; a=(LL)a*a%p; b>>=1; } cout<