#includedouble power(int x,int n){double y=1;int i;for(i=n;i>1;i--)y*=x;}main(){ double power(int x,int n);int x,n;printf("input x&n:\n");scanf("%d%d",&x,&n);printf("power(%d,%d)=%ld",x,n,power(x,n));getch();}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 06:28:13
#includedoublepower(intx,intn){doubley=1;inti;for(i=n;i>1;i--)y*=x;}main(){doublepower(intx,intn);in

#includedouble power(int x,int n){double y=1;int i;for(i=n;i>1;i--)y*=x;}main(){ double power(int x,int n);int x,n;printf("input x&n:\n");scanf("%d%d",&x,&n);printf("power(%d,%d)=%ld",x,n,power(x,n));getch();}
#include
double power(int x,int n)
{double y=1;
int i;
for(i=n;i>1;i--)
y*=x;
}
main()
{ double power(int x,int n);
int x,n;
printf("input x&n:\n");
scanf("%d%d",&x,&n);
printf("power(%d,%d)=%ld",x,n,power(x,n));
getch();
}

#includedouble power(int x,int n){double y=1;int i;for(i=n;i>1;i--)y*=x;}main(){ double power(int x,int n);int x,n;printf("input x&n:\n");scanf("%d%d",&x,&n);printf("power(%d,%d)=%ld",x,n,power(x,n));getch();}
#include
#include
int power(int x,int n)
{
int y=1;
int i=0;
for(i=n;i>0;i--)
y*=x;
return y;
}
int main()
{
int x=0,n=0;
printf("input x&n:\n");
scanf("%d%d",&x,&n);
printf("power(%d,%d)=%d",x,n,power(x,n));
getch();
return 0;
}