初学C,求助!
无法运行,不知道问题在哪啊?求助专家!#include<stdio.h>
double power(double x,double y);
void main()
{
double a,b,result;
printf("Please put the number!\n");
scanf("%f,%f",&a,&b);
result=power(a,b);
printf("The number is %.1f\n",result);
}
double power(double x, double y)
{
double z=1;
while(y)
{
z =z*x;
--y;
}
return z;
}
double型数据输入的时候用%lf,你试下应该可以了 return z; 换成return 0;
页:
[1]