#include <iostream> #include <cstdio> using namespace std; int a,b; long long qp(int a,int b) { int t=1;int y=a; while (b) { if (b&1) t=t*y;//whether obb or not y=y*y; b=b>>1; //cout << a << " " << b << " " << t << " " << y << endl; } return(t); } int main() { scanf("%d %d",&a,&b); printf("%lld",qp(a,b)); }
时间: 2024-10-09 04:03:17