1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
|
#include<iostream>
using namespace std;
float potenz(int,int);
float potenz(int b,int x){
float p=1;
float t=1/b;
x=x*(-1);
for(int i=1;i<=x;i++){
p=p*t;
}
return p;
}
int main(){
cout<<potenz(2,-2);
return 0;
}
|