#include <iostream.h>
float power(float x, int pow);
void main()
{
float f = 0;
while(f <= 20) {
cout << f << " " << power(f,2) << " " << power(f,3)
<< " " << power(f,4) << endl;
f++;
}
}
float power(float x, int pow)
{
float result = 1.0;
if(pow < 0) {
while(pow < 0) {
result /= x;
pow++;
}
}
else {
while(pow > 0) {
result *= x;
pow--;
}
}
return(result);
}