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;
  8. cin>>a>>b;
  9. while(b)
  10. {
  11.  
  12. if(b&1)
  13. {
  14. r=r*a;
  15. }
  16. a=a * a;
  17. b=b>>1;
  18. }
  19. cout<<r<<endl;
  20. return 0;
  21.  
  22.  
  23.  
  24.  
  25.  
  26. }
Success #stdin #stdout 0.01s 5288KB
stdin
2
6
stdout
0