vc源程序,怎么老是编译不通过,小弟不才,请诸位高手指点。
#include<iostream.h>doublepower(doublex,intn);intmain(){cout<<"5tothepower2is"<<power...
#include<iostream.h>
double power(double x,int n);
int main()
{
cout<<"5 to the power 2 is"<<power(5,2)<<endl;
return 0;
}
double power(double x,int n);
{
double val=1.0;
while (n--)
val*=x;
return (val)
} 展开
double power(double x,int n);
int main()
{
cout<<"5 to the power 2 is"<<power(5,2)<<endl;
return 0;
}
double power(double x,int n);
{
double val=1.0;
while (n--)
val*=x;
return (val)
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询