fork download
  1. #include <stdio.h>
  2.  
  3. int power(int x,int n)
  4. {
  5. if(n==0)
  6. return 1;
  7. else
  8. return x * power(x,n-1);
  9. }
  10.  
  11. int main(void) {
  12. int x,n;
  13.  
  14. scanf("%d %d",&x,&n);
  15. printf("%d",power(x,n));
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5324KB
stdin
2 0
stdout
1