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