You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <iostream>
|
|
using namespace std;
|
|
double power(double x, int n)
|
|
{
|
|
double val = 1.0;
|
|
while (n--) val *= x;
|
|
return val;
|
|
|
|
}
|
|
int main() {
|
|
double x;
|
|
int y;
|
|
cin >> x;
|
|
cin >> y;
|
|
cout<<power(x,y);
|
|
} |