fork download
  1. #include <stdio.h>
  2.  
  3. int fuga(int x,int y){
  4. int sum=1,i;
  5. if( y==0 ){
  6. return 1;
  7. }
  8. for(i=0;i<y;i++) sum*=x;
  9.  
  10.  
  11. return sum+fuga(x,y-1);
  12.  
  13. }
  14.  
  15.  
  16.  
  17.  
  18. int main(void) {
  19. int x=2,y=3,result;
  20. result=fuga(x,y);
  21. printf("%d",result);
  22. }
  23.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
15