fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int intpow(int x,int y)
  5. {
  6. int R=1,i;
  7. for(i=1;i<y;i<<=1,x*=x) if(i&y) R*=x;
  8. return R;
  9. }
  10.  
  11. int main()
  12. {
  13. printf("%d\t%d\t%d",intpow(3,3),intpow(2,10),intpow(2,3));
  14. return 0;
  15. }
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
27	1024	8