Home > Back-end >  Ask a question
Ask a question

Time:05-26

# include & lt; Stdio. H>
Int w=3
Int fun (int k)
{
If (k==0) return w;
Return (fun (k - 1) * k);
}
Int main ()
{
Int w=10;
Printf (" % d \ n, fun (5) * w ");
return 0;
}
The answer is 3600, but how do I calculate is not to come out, also please guidance

CodePudding user response:

Reference:
 # include & lt; Stdio. H> 
Int w=3;
Int fun (int k)
{
If (k==0) return w;
Return (fun (k - 1) * k);
}
Int main ()
{
Int w=10;
Printf (" % d \ n ", fun (5) * w);

return 0;
}

CodePudding user response:

reference 1st floor QZJHJXJ response:
for reference:
 # include & lt; Stdio. H> 
Int w=3;
Int fun (int k)
{
If (k==0) return w;
Return (fun (k - 1) * k);
}
Int main ()
{
Int w=10;
Printf (" % d \ n ", fun (5) * w);

return 0;
}

See, 5 * 4 * 3 * 2 * 1 * 3 * 10
  • Related