#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/04/28 02:06:13
#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(

#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;
}