c語言type錯誤怎么解決?
#include <stdio.h>
int main ()
{
double power (double x,double y);
double result;
double x=2.0,y=3.0;
result = power (x , y);
printf("%f的%f次方等于%f",x,y,result);while(1);
return 0;
}
double power (double x,double y)
{
double z=1,i;
for(i=1;i<=y;i++)
{
z=z*x;
}
return z;
}