include<stdio.h>
int Power(inta,int b);
int main(void){
intx,y,z;
printf("Input two numbers:");
scanf("%d %d",&x,&y);
if(x>0&&y>0)
z=Power(x,y)·
else
z=0;
printf("The result is %d.\n",z); }
int power(int a,intb){
if(a<b)
return 0;
else
return 1+Power(a/b,b);
}
a.给定以下输入,给出完整输出。
(1)4 9
(2)27 5
(3)-1 3
b.Power函数的功能是什么?
c.图17-19所示是Power函数调用后的栈快照。其中显示的是两段活动记录,且部分内容已填写。假设该快照反映的是Power函数中某个return语句执行之前的情况,试填写图中标记为问号(?)的位置内容。如果位置内容是地址值,请用箭头标出该地址所指向的位置。
