int ans=1; while(n) { if(n&1) ans=ans*x; x*=x; n>>=1; }
求x^n
原文地址:https://www.cnblogs.com/Tidoblogs/p/11219885.html
时间: 2024-08-30 18:05:01
int ans=1; while(n) { if(n&1) ans=ans*x; x*=x; n>>=1; }
求x^n
原文地址:https://www.cnblogs.com/Tidoblogs/p/11219885.html