关于幂积的C语言程序问题求高手指点,小弟刚学C语言

#include<stdio.h>
long power(int a,int b);
main()
{
int s;
s=power(4,3);
printf("the results:%d",s);
}
long power(int a,int b);

{long f;
if(b==0)
f=1;
else
f=a*power(a,b-1);
return f;
}

#include "stdafx.h"
long power(int a,int b);
void main()
{
int s;
s=power(4,3);
printf("the results:%d",s);
}
long power(int a,int b)
{long f;
  if(b==0)
  f=1;
  else
  f=a*power(a,b-1);
  return f;
}

追问

好像还是不行,在页面上运行不行

追答

复制我的代码

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜