Problem I: 下面的函数功能是x的y次方.
Description
下面的函数功能是x的y次方, 加入适当的语句。
#include <iostream>
using namespace std;
double fun(double x,int y)
{ int i;double z =1;
for(i=1;i<=y;i++)
z= ;
return z;
}
int main()
{ double x;int y;
cin>>x>>y;
cout<<fun(x,y)<<endl;
return 0;
}
Input
输入x,y的值。
Output
x的y次方。
Sample Input
2.0 3
Sample Output
8