求指错啊。。。急,是求幂的。。。
#include<stdio.h>double hanshu(double x,int i);
int main(void)
{
double x;
int i;
printf("please print x and i:\n");
scanf("%.2f %d",&x,&i);
printf("%.3f\n",hanshu(x,i));
return 0;
}
double hanshu(double x,int i)
{
double a;
int b;
for(a=1,b=1;b<=i;b++)
{
a=a*x;
}
return a;
}