fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int a,b;
  7. int r=1;
  8. cin>>a>>b;
  9. while(b)
  10. {
  11. if(b&1)
  12. {
  13. r=r*a;
  14. }
  15. a=a*a;
  16. b=b>>1;
  17. }
  18. cout<<r<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5288KB
stdin
2
5
stdout
32