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